diff --git a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java
index 90394ce..5ea28ab 100644
--- a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java
+++ b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java
@@ -18,6 +18,7 @@
 
 import android.graphics.Rect;
 import android.text.TextUtils;
+import android.util.FloatMath;
 
 import com.android.inputmethod.keyboard.Keyboard.Params.TouchPositionCorrection;
 import com.android.inputmethod.latin.JniUtils;
@@ -147,7 +148,7 @@
                     final float radius = touchPositionCorrection.mRadii[row];
                     sweetSpotCenterXs[i] = hitBoxCenterX + x * hitBoxWidth;
                     sweetSpotCenterYs[i] = hitBoxCenterY + y * hitBoxHeight;
-                    sweetSpotRadii[i] = radius * (float) Math.sqrt(
+                    sweetSpotRadii[i] = radius * FloatMath.sqrt(
                             hitBoxWidth * hitBoxWidth + hitBoxHeight * hitBoxHeight);
                 }
             }
diff --git a/java/src/com/android/inputmethod/latin/AutoCorrection.java b/java/src/com/android/inputmethod/latin/AutoCorrection.java
index 38444a1..da1936a 100644
--- a/java/src/com/android/inputmethod/latin/AutoCorrection.java
+++ b/java/src/com/android/inputmethod/latin/AutoCorrection.java
@@ -35,7 +35,7 @@
     public static CharSequence computeAutoCorrectionWord(
             HashMap<String, Dictionary> dictionaries,
             WordComposer wordComposer, ArrayList<SuggestedWordInfo> suggestions,
-            CharSequence consideredWord, double autoCorrectionThreshold,
+            CharSequence consideredWord, float autoCorrectionThreshold,
             CharSequence whitelistedWord) {
         if (hasAutoCorrectionForWhitelistedWord(whitelistedWord)) {
             return whitelistedWord;
@@ -100,14 +100,14 @@
 
     private static boolean hasAutoCorrectionForBinaryDictionary(WordComposer wordComposer,
             ArrayList<SuggestedWordInfo> suggestions,
-            CharSequence consideredWord, double autoCorrectionThreshold) {
+            CharSequence consideredWord, float autoCorrectionThreshold) {
         if (wordComposer.size() > 1 && suggestions.size() > 0) {
             final SuggestedWordInfo autoCorrectionSuggestion = suggestions.get(0);
             //final int autoCorrectionSuggestionScore = sortedScores[0];
             final int autoCorrectionSuggestionScore = autoCorrectionSuggestion.mScore;
             // TODO: when the normalized score of the first suggestion is nearly equals to
             //       the normalized score of the second suggestion, behave less aggressive.
-            final double normalizedScore = BinaryDictionary.calcNormalizedScore(
+            final float normalizedScore = BinaryDictionary.calcNormalizedScore(
                     consideredWord.toString(), autoCorrectionSuggestion.mWord.toString(),
                     autoCorrectionSuggestionScore);
             if (DBG) {
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index cc20f42..e18aee6 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -92,7 +92,7 @@
     private native int getBigramsNative(long dict, int[] prevWord, int prevWordLength,
             int[] inputCodes, int inputCodesLength, char[] outputChars, int[] scores,
             int maxWordLength, int maxBigrams);
-    private static native double calcNormalizedScoreNative(
+    private static native float calcNormalizedScoreNative(
             char[] before, int beforeLength, char[] after, int afterLength, int score);
     private static native int editDistanceNative(
             char[] before, int beforeLength, char[] after, int afterLength);
@@ -189,7 +189,7 @@
                 prevWordCodePointArray, mUseFullEditDistance, outputChars, scores);
     }
 
-    public static double calcNormalizedScore(String before, String after, int score) {
+    public static float calcNormalizedScore(String before, String after, int score) {
         return calcNormalizedScoreNative(before.toCharArray(), before.length(),
                 after.toCharArray(), after.length(), score);
     }
diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java
index 55b896f..932920a 100644
--- a/java/src/com/android/inputmethod/latin/SettingsValues.java
+++ b/java/src/com/android/inputmethod/latin/SettingsValues.java
@@ -77,7 +77,7 @@
     public final float mFxVolume;
     public final int mKeyPreviewPopupDismissDelay;
     public final boolean mAutoCorrectEnabled;
-    public final double mAutoCorrectionThreshold;
+    public final float mAutoCorrectionThreshold;
     private final boolean mVoiceKeyEnabled;
     private final boolean mVoiceKeyOnMain;
 
@@ -255,21 +255,21 @@
                 R.bool.config_default_next_word_prediction));
     }
 
-    private static double getAutoCorrectionThreshold(final Resources resources,
+    private static float getAutoCorrectionThreshold(final Resources resources,
             final String currentAutoCorrectionSetting) {
         final String[] autoCorrectionThresholdValues = resources.getStringArray(
                 R.array.auto_correction_threshold_values);
         // When autoCorrectionThreshold is greater than 1.0, it's like auto correction is off.
-        double autoCorrectionThreshold = Double.MAX_VALUE;
+        float autoCorrectionThreshold = Float.MAX_VALUE;
         try {
             final int arrayIndex = Integer.valueOf(currentAutoCorrectionSetting);
             if (arrayIndex >= 0 && arrayIndex < autoCorrectionThresholdValues.length) {
-                autoCorrectionThreshold = Double.parseDouble(
+                autoCorrectionThreshold = Float.parseFloat(
                         autoCorrectionThresholdValues[arrayIndex]);
             }
         } catch (NumberFormatException e) {
             // Whenever the threshold settings are correct, never come here.
-            autoCorrectionThreshold = Double.MAX_VALUE;
+            autoCorrectionThreshold = Float.MAX_VALUE;
             Log.w(TAG, "Cannot load auto correction threshold setting."
                     + " currentAutoCorrectionSetting: " + currentAutoCorrectionSetting
                     + ", autoCorrectionThresholdValues: "
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index d7cd057..9e478fa 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -77,7 +77,7 @@
 
     private static final int PREF_MAX_BIGRAMS = 60;
 
-    private double mAutoCorrectionThreshold;
+    private float mAutoCorrectionThreshold;
 
     private ArrayList<SuggestedWordInfo> mSuggestions = new ArrayList<SuggestedWordInfo>();
     private ArrayList<SuggestedWordInfo> mBigramSuggestions = new ArrayList<SuggestedWordInfo>();
@@ -185,7 +185,7 @@
                 userHistoryDictionary);
     }
 
-    public void setAutoCorrectionThreshold(double threshold) {
+    public void setAutoCorrectionThreshold(float threshold) {
         mAutoCorrectionThreshold = threshold;
     }
 
@@ -416,7 +416,7 @@
         // than i because we added the typed word to mSuggestions without touching mScores.
         for (int i = 0; i < suggestionsSize - 1; ++i) {
             final SuggestedWordInfo cur = suggestions.get(i + 1);
-            final double normalizedScore = BinaryDictionary.calcNormalizedScore(
+            final float normalizedScore = BinaryDictionary.calcNormalizedScore(
                     typedWord, cur.toString(), cur.mScore);
             final String scoreInfoString;
             if (normalizedScore > 0) {
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
index 0c9f9fb..d7c8e38 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
@@ -79,9 +79,9 @@
     private Dictionary mContactsDictionary;
 
     // The threshold for a candidate to be offered as a suggestion.
-    private double mSuggestionThreshold;
+    private float mSuggestionThreshold;
     // The threshold for a suggestion to be considered "recommended".
-    private double mRecommendedThreshold;
+    private float mRecommendedThreshold;
     // Whether to use the contacts dictionary
     private boolean mUseContactsDictionary;
     private final Object mUseContactsLock = new Object();
@@ -113,9 +113,9 @@
     @Override public void onCreate() {
         super.onCreate();
         mSuggestionThreshold =
-                Double.parseDouble(getString(R.string.spellchecker_suggestion_threshold_value));
+                Float.parseFloat(getString(R.string.spellchecker_suggestion_threshold_value));
         mRecommendedThreshold =
-                Double.parseDouble(getString(R.string.spellchecker_recommended_threshold_value));
+                Float.parseFloat(getString(R.string.spellchecker_recommended_threshold_value));
         final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
         prefs.registerOnSharedPreferenceChangeListener(this);
         onSharedPreferenceChanged(prefs, PREF_USE_CONTACTS_KEY);
@@ -207,8 +207,8 @@
         private final ArrayList<CharSequence> mSuggestions;
         private final int[] mScores;
         private final String mOriginalText;
-        private final double mSuggestionThreshold;
-        private final double mRecommendedThreshold;
+        private final float mSuggestionThreshold;
+        private final float mRecommendedThreshold;
         private final int mMaxLength;
         private int mLength = 0;
 
@@ -217,8 +217,8 @@
         private String mBestSuggestion = null;
         private int mBestScore = Integer.MIN_VALUE; // As small as possible
 
-        SuggestionsGatherer(final String originalText, final double suggestionThreshold,
-                final double recommendedThreshold, final int maxLength) {
+        SuggestionsGatherer(final String originalText, final float suggestionThreshold,
+                final float recommendedThreshold, final int maxLength) {
             mOriginalText = originalText;
             mSuggestionThreshold = suggestionThreshold;
             mRecommendedThreshold = recommendedThreshold;
@@ -261,7 +261,7 @@
             // Compute the normalized score and skip this word if it's normalized score does not
             // make the threshold.
             final String wordString = new String(word, wordOffset, wordLength);
-            final double normalizedScore =
+            final float normalizedScore =
                     BinaryDictionary.calcNormalizedScore(mOriginalText, wordString, score);
             if (normalizedScore < mSuggestionThreshold) {
                 if (DBG) Log.i(TAG, wordString + " does not make the score threshold");
@@ -295,7 +295,7 @@
                     hasRecommendedSuggestions = false;
                 } else {
                     gatheredSuggestions = EMPTY_STRING_ARRAY;
-                    final double normalizedScore = BinaryDictionary.calcNormalizedScore(
+                    final float normalizedScore = BinaryDictionary.calcNormalizedScore(
                             mOriginalText, mBestSuggestion, mBestScore);
                     hasRecommendedSuggestions = (normalizedScore > mRecommendedThreshold);
                 }
@@ -329,7 +329,7 @@
 
                 final int bestScore = mScores[mLength - 1];
                 final CharSequence bestSuggestion = mSuggestions.get(0);
-                final double normalizedScore =
+                final float normalizedScore =
                         BinaryDictionary.calcNormalizedScore(
                                 mOriginalText, bestSuggestion.toString(), bestScore);
                 hasRecommendedSuggestions = (normalizedScore > mRecommendedThreshold);
diff --git a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
index b8f4ec7..0fe4564 100644
--- a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
+++ b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp
@@ -196,11 +196,11 @@
     return result;
 }
 
-static jdouble latinime_BinaryDictionary_calcNormalizedScore(JNIEnv *env, jobject object,
+static jfloat latinime_BinaryDictionary_calcNormalizedScore(JNIEnv *env, jobject object,
         jcharArray before, jint beforeLength, jcharArray after, jint afterLength, jint score) {
     jchar *beforeChars = env->GetCharArrayElements(before, 0);
     jchar *afterChars = env->GetCharArrayElements(after, 0);
-    jdouble result = Correction::RankingAlgorithm::calcNormalizedScore((unsigned short*)beforeChars,
+    jfloat result = Correction::RankingAlgorithm::calcNormalizedScore((unsigned short*)beforeChars,
             beforeLength, (unsigned short*)afterChars, afterLength, score);
     env->ReleaseCharArrayElements(after, afterChars, JNI_ABORT);
     env->ReleaseCharArrayElements(before, beforeChars, JNI_ABORT);
@@ -255,7 +255,7 @@
     {"isValidWordNative", "(J[II)Z", (void*)latinime_BinaryDictionary_isValidWord},
     {"isValidBigramNative", "(J[I[I)Z", (void*)latinime_BinaryDictionary_isValidBigram},
     {"getBigramsNative", "(J[II[II[C[III)I", (void*)latinime_BinaryDictionary_getBigrams},
-    {"calcNormalizedScoreNative", "([CI[CII)D",
+    {"calcNormalizedScoreNative", "([CI[CII)F",
             (void*)latinime_BinaryDictionary_calcNormalizedScore},
     {"editDistanceNative", "([CI[CI)I", (void*)latinime_BinaryDictionary_editDistance}
 };
diff --git a/native/jni/src/correction.cpp b/native/jni/src/correction.cpp
index a1f8129..5ae34cd 100644
--- a/native/jni/src/correction.cpp
+++ b/native/jni/src/correction.cpp
@@ -1113,7 +1113,7 @@
 // So, we can normalize original score by dividing pow(2, min(b.l(),a.l())) * 255 * 2.
 
 /* static */
-double Correction::RankingAlgorithm::calcNormalizedScore(const unsigned short* before,
+float Correction::RankingAlgorithm::calcNormalizedScore(const unsigned short* before,
         const int beforeLength, const unsigned short* after, const int afterLength,
         const int score) {
     if (0 == beforeLength || 0 == afterLength) {
@@ -1131,14 +1131,14 @@
         return 0;
     }
 
-    const double maxScore = score >= S_INT_MAX ? S_INT_MAX : MAX_INITIAL_SCORE
-            * pow((double)TYPED_LETTER_MULTIPLIER,
-                    (double)min(beforeLength, afterLength - spaceCount)) * FULL_WORD_MULTIPLIER;
+    const float maxScore = score >= S_INT_MAX ? S_INT_MAX : MAX_INITIAL_SCORE
+            * pow((float)TYPED_LETTER_MULTIPLIER,
+                    (float)min(beforeLength, afterLength - spaceCount)) * FULL_WORD_MULTIPLIER;
 
     // add a weight based on edit distance.
     // distance <= max(afterLength, beforeLength) == afterLength,
     // so, 0 <= distance / afterLength <= 1
-    const double weight = 1.0 - (double) distance / afterLength;
+    const float weight = 1.0 - (float) distance / afterLength;
     return (score / maxScore) * weight;
 }
 
diff --git a/native/jni/src/correction.h b/native/jni/src/correction.h
index 1b4e4bf..1ac4b87 100644
--- a/native/jni/src/correction.h
+++ b/native/jni/src/correction.h
@@ -162,7 +162,7 @@
         static int calcFreqForSplitMultipleWords(const int *freqArray, const int *wordLengthArray,
                 const int wordCount, const Correction* correction, const bool isSpaceProximity,
                 const unsigned short *word);
-        static double calcNormalizedScore(const unsigned short* before, const int beforeLength,
+        static float calcNormalizedScore(const unsigned short* before, const int beforeLength,
                 const unsigned short* after, const int afterLength, const int score);
         static int editDistance(const unsigned short* before,
                 const int beforeLength, const unsigned short* after, const int afterLength);
diff --git a/native/jni/src/defines.h b/native/jni/src/defines.h
index cb3dbb1..c6ad66a 100644
--- a/native/jni/src/defines.h
+++ b/native/jni/src/defines.h
@@ -46,8 +46,8 @@
 #include <time.h>
 
 #define PROF_BUF_SIZE 100
-static double profile_buf[PROF_BUF_SIZE];
-static double profile_old[PROF_BUF_SIZE];
+static float profile_buf[PROF_BUF_SIZE];
+static float profile_old[PROF_BUF_SIZE];
 static unsigned int profile_counter[PROF_BUF_SIZE];
 
 #define PROF_RESET               prof_reset()
@@ -74,8 +74,8 @@
         AKLOGI("Error: You must call PROF_OPEN before PROF_CLOSE.");
     }
     AKLOGI("Total time is %6.3f ms.",
-            profile_buf[PROF_BUF_SIZE - 1] * 1000 / (double)CLOCKS_PER_SEC);
-    double all = 0;
+            profile_buf[PROF_BUF_SIZE - 1] * 1000 / (float)CLOCKS_PER_SEC);
+    float all = 0;
     for (int i = 0; i < PROF_BUF_SIZE - 1; ++i) {
         all += profile_buf[i];
     }
@@ -84,7 +84,7 @@
         if (profile_buf[i] != 0) {
             AKLOGI("(%d): Used %4.2f%%, %8.4f ms. Called %d times.",
                     i, (profile_buf[i] * 100 / all),
-                    profile_buf[i] * 1000 / (double)CLOCKS_PER_SEC, profile_counter[i]);
+                    profile_buf[i] * 1000 / (float)CLOCKS_PER_SEC, profile_counter[i]);
         }
     }
 }
diff --git a/native/jni/src/unigram_dictionary.cpp b/native/jni/src/unigram_dictionary.cpp
index 43fe892..ee8c497 100644
--- a/native/jni/src/unigram_dictionary.cpp
+++ b/native/jni/src/unigram_dictionary.cpp
@@ -202,7 +202,7 @@
 
     PROF_START(20);
     if (DEBUG_DICT) {
-        double ns = queuePool->getMasterQueue()->getHighestNormalizedScore(
+        float ns = queuePool->getMasterQueue()->getHighestNormalizedScore(
                 proximityInfo->getPrimaryInputWord(), codesSize, 0, 0, 0);
         ns += 0;
         AKLOGI("Max normalized score = %f", ns);
@@ -212,7 +212,7 @@
                     proximityInfo->getPrimaryInputWord(), codesSize, frequencies, outWords);
 
     if (DEBUG_DICT) {
-        double ns = queuePool->getMasterQueue()->getHighestNormalizedScore(
+        float ns = queuePool->getMasterQueue()->getHighestNormalizedScore(
                 proximityInfo->getPrimaryInputWord(), codesSize, 0, 0, 0);
         ns += 0;
         AKLOGI("Returning %d words", suggestedWordsCount);
@@ -255,7 +255,7 @@
     bool hasAutoCorrectionCandidate = false;
     WordsPriorityQueue* masterQueue = queuePool->getMasterQueue();
     if (masterQueue->size() > 0) {
-        double nsForMaster = masterQueue->getHighestNormalizedScore(
+        float nsForMaster = masterQueue->getHighestNormalizedScore(
                 proximityInfo->getPrimaryInputWord(), inputLength, 0, 0, 0);
         hasAutoCorrectionCandidate = (nsForMaster > START_TWO_WORDS_CORRECTION_THRESHOLD);
     }
@@ -284,7 +284,7 @@
                 const int score = sw->mScore;
                 const unsigned short* word = sw->mWord;
                 const int wordLength = sw->mWordLength;
-                double ns = Correction::RankingAlgorithm::calcNormalizedScore(
+                float ns = Correction::RankingAlgorithm::calcNormalizedScore(
                         proximityInfo->getPrimaryInputWord(), i, word, wordLength, score);
                 ns += 0;
                 AKLOGI("--- TOP SUB WORDS for %d --- %d %f [%d]", i, score, ns,
@@ -452,7 +452,7 @@
             return false;
         }
         int score = 0;
-        const double ns = queue->getHighestNormalizedScore(
+        const float ns = queue->getHighestNormalizedScore(
                 proximityInfo->getPrimaryInputWord(), inputWordLength,
                 &tempOutputWord, &score, &nextWordLength);
         if (DEBUG_DICT) {
diff --git a/native/jni/src/words_priority_queue.h b/native/jni/src/words_priority_queue.h
index 1387267..7629251 100644
--- a/native/jni/src/words_priority_queue.h
+++ b/native/jni/src/words_priority_queue.h
@@ -112,13 +112,13 @@
         if (size >= 2) {
             SuggestedWord* nsMaxSw = 0;
             unsigned int maxIndex = 0;
-            double maxNs = 0;
+            float maxNs = 0;
             for (unsigned int i = 0; i < size; ++i) {
                 SuggestedWord* tempSw = swBuffer[i];
                 if (!tempSw) {
                     continue;
                 }
-                const double tempNs = getNormalizedScore(tempSw, before, beforeLength, 0, 0, 0);
+                const float tempNs = getNormalizedScore(tempSw, before, beforeLength, 0, 0, 0);
                 if (tempNs >= maxNs) {
                     maxNs = tempNs;
                     maxIndex = i;
@@ -172,7 +172,7 @@
         DUMP_WORD(mHighestSuggestedWord->mWord, mHighestSuggestedWord->mWordLength);
     }
 
-    double getHighestNormalizedScore(const unsigned short* before, const int beforeLength,
+    float getHighestNormalizedScore(const unsigned short* before, const int beforeLength,
             unsigned short** outWord, int *outScore, int *outLength) {
         if (!mHighestSuggestedWord) {
             return 0.0;
@@ -199,7 +199,7 @@
         return 0;
     }
 
-    static double getNormalizedScore(SuggestedWord* sw, const unsigned short* before,
+    static float getNormalizedScore(SuggestedWord* sw, const unsigned short* before,
             const int beforeLength, unsigned short** outWord, int *outScore, int *outLength) {
         const int score = sw->mScore;
         unsigned short* word = sw->mWord;
