Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2

Percentage Accurate: 99.8% → 99.8%
Time: 6.4s
Alternatives: 5
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \end{array} \]
(FPCore (x) :precision binary64 (* (* x x) (- 3.0 (* x 2.0))))
double code(double x) {
	return (x * x) * (3.0 - (x * 2.0));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (x * x) * (3.0d0 - (x * 2.0d0))
end function
public static double code(double x) {
	return (x * x) * (3.0 - (x * 2.0));
}
def code(x):
	return (x * x) * (3.0 - (x * 2.0))
function code(x)
	return Float64(Float64(x * x) * Float64(3.0 - Float64(x * 2.0)))
end
function tmp = code(x)
	tmp = (x * x) * (3.0 - (x * 2.0));
end
code[x_] := N[(N[(x * x), $MachinePrecision] * N[(3.0 - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 5 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \end{array} \]
(FPCore (x) :precision binary64 (* (* x x) (- 3.0 (* x 2.0))))
double code(double x) {
	return (x * x) * (3.0 - (x * 2.0));
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (x * x) * (3.0d0 - (x * 2.0d0))
end function
public static double code(double x) {
	return (x * x) * (3.0 - (x * 2.0));
}
def code(x):
	return (x * x) * (3.0 - (x * 2.0))
function code(x)
	return Float64(Float64(x * x) * Float64(3.0 - Float64(x * 2.0)))
end
function tmp = code(x)
	tmp = (x * x) * (3.0 - (x * 2.0));
end
code[x_] := N[(N[(x * x), $MachinePrecision] * N[(3.0 - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)
\end{array}

Alternative 1: 99.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \left(\mathsf{fma}\left(-2, x, 3\right) \cdot x\right) \cdot x \end{array} \]
(FPCore (x) :precision binary64 (* (* (fma -2.0 x 3.0) x) x))
double code(double x) {
	return (fma(-2.0, x, 3.0) * x) * x;
}
function code(x)
	return Float64(Float64(fma(-2.0, x, 3.0) * x) * x)
end
code[x_] := N[(N[(N[(-2.0 * x + 3.0), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}

\\
\left(\mathsf{fma}\left(-2, x, 3\right) \cdot x\right) \cdot x
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)} \]
    2. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot \left(3 - x \cdot 2\right) \]
    3. associate-*l*N/A

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)} \]
    4. *-commutativeN/A

      \[\leadsto \color{blue}{\left(x \cdot \left(3 - x \cdot 2\right)\right) \cdot x} \]
    5. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(x \cdot \left(3 - x \cdot 2\right)\right) \cdot x} \]
    6. *-commutativeN/A

      \[\leadsto \color{blue}{\left(\left(3 - x \cdot 2\right) \cdot x\right)} \cdot x \]
    7. lower-*.f6499.8

      \[\leadsto \color{blue}{\left(\left(3 - x \cdot 2\right) \cdot x\right)} \cdot x \]
    8. lift--.f64N/A

      \[\leadsto \left(\color{blue}{\left(3 - x \cdot 2\right)} \cdot x\right) \cdot x \]
    9. sub-negN/A

      \[\leadsto \left(\color{blue}{\left(3 + \left(\mathsf{neg}\left(x \cdot 2\right)\right)\right)} \cdot x\right) \cdot x \]
    10. +-commutativeN/A

      \[\leadsto \left(\color{blue}{\left(\left(\mathsf{neg}\left(x \cdot 2\right)\right) + 3\right)} \cdot x\right) \cdot x \]
    11. lift-*.f64N/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{x \cdot 2}\right)\right) + 3\right) \cdot x\right) \cdot x \]
    12. *-commutativeN/A

      \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{2 \cdot x}\right)\right) + 3\right) \cdot x\right) \cdot x \]
    13. distribute-lft-neg-inN/A

      \[\leadsto \left(\left(\color{blue}{\left(\mathsf{neg}\left(2\right)\right) \cdot x} + 3\right) \cdot x\right) \cdot x \]
    14. lower-fma.f64N/A

      \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(2\right), x, 3\right)} \cdot x\right) \cdot x \]
    15. metadata-eval99.8

      \[\leadsto \left(\mathsf{fma}\left(\color{blue}{-2}, x, 3\right) \cdot x\right) \cdot x \]
  4. Applied rewrites99.8%

    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(-2, x, 3\right) \cdot x\right) \cdot x} \]
  5. Add Preprocessing

Alternative 2: 97.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(3 - 2 \cdot x\right) \cdot \left(x \cdot x\right)\\ t_1 := \left(x \cdot -2\right) \cdot \left(x \cdot x\right)\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-8}:\\ \;\;\;\;\left(3 \cdot x\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* (- 3.0 (* 2.0 x)) (* x x))) (t_1 (* (* x -2.0) (* x x))))
   (if (<= t_0 -5e+19) t_1 (if (<= t_0 5e-8) (* (* 3.0 x) x) t_1))))
double code(double x) {
	double t_0 = (3.0 - (2.0 * x)) * (x * x);
	double t_1 = (x * -2.0) * (x * x);
	double tmp;
	if (t_0 <= -5e+19) {
		tmp = t_1;
	} else if (t_0 <= 5e-8) {
		tmp = (3.0 * x) * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (3.0d0 - (2.0d0 * x)) * (x * x)
    t_1 = (x * (-2.0d0)) * (x * x)
    if (t_0 <= (-5d+19)) then
        tmp = t_1
    else if (t_0 <= 5d-8) then
        tmp = (3.0d0 * x) * x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x) {
	double t_0 = (3.0 - (2.0 * x)) * (x * x);
	double t_1 = (x * -2.0) * (x * x);
	double tmp;
	if (t_0 <= -5e+19) {
		tmp = t_1;
	} else if (t_0 <= 5e-8) {
		tmp = (3.0 * x) * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x):
	t_0 = (3.0 - (2.0 * x)) * (x * x)
	t_1 = (x * -2.0) * (x * x)
	tmp = 0
	if t_0 <= -5e+19:
		tmp = t_1
	elif t_0 <= 5e-8:
		tmp = (3.0 * x) * x
	else:
		tmp = t_1
	return tmp
function code(x)
	t_0 = Float64(Float64(3.0 - Float64(2.0 * x)) * Float64(x * x))
	t_1 = Float64(Float64(x * -2.0) * Float64(x * x))
	tmp = 0.0
	if (t_0 <= -5e+19)
		tmp = t_1;
	elseif (t_0 <= 5e-8)
		tmp = Float64(Float64(3.0 * x) * x);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x)
	t_0 = (3.0 - (2.0 * x)) * (x * x);
	t_1 = (x * -2.0) * (x * x);
	tmp = 0.0;
	if (t_0 <= -5e+19)
		tmp = t_1;
	elseif (t_0 <= 5e-8)
		tmp = (3.0 * x) * x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_] := Block[{t$95$0 = N[(N[(3.0 - N[(2.0 * x), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * -2.0), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+19], t$95$1, If[LessEqual[t$95$0, 5e-8], N[(N[(3.0 * x), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(3 - 2 \cdot x\right) \cdot \left(x \cdot x\right)\\
t_1 := \left(x \cdot -2\right) \cdot \left(x \cdot x\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\left(3 \cdot x\right) \cdot x\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 x x) (-.f64 #s(literal 3 binary64) (*.f64 x #s(literal 2 binary64)))) < -5e19 or 4.9999999999999998e-8 < (*.f64 (*.f64 x x) (-.f64 #s(literal 3 binary64) (*.f64 x #s(literal 2 binary64))))

    1. Initial program 99.9%

      \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(-2 \cdot x\right)} \]
    4. Step-by-step derivation
      1. lower-*.f6499.4

        \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(-2 \cdot x\right)} \]
    5. Applied rewrites99.4%

      \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(-2 \cdot x\right)} \]

    if -5e19 < (*.f64 (*.f64 x x) (-.f64 #s(literal 3 binary64) (*.f64 x #s(literal 2 binary64)))) < 4.9999999999999998e-8

    1. Initial program 99.7%

      \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{3} \]
    4. Step-by-step derivation
      1. Applied rewrites98.8%

        \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{3} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot 3} \]
        2. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot 3 \]
        3. associate-*l*N/A

          \[\leadsto \color{blue}{x \cdot \left(x \cdot 3\right)} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{\left(x \cdot 3\right) \cdot x} \]
        5. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot 3\right) \cdot x} \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{\left(3 \cdot x\right)} \cdot x \]
        7. lower-*.f6498.9

          \[\leadsto \color{blue}{\left(3 \cdot x\right)} \cdot x \]
      3. Applied rewrites98.9%

        \[\leadsto \color{blue}{\left(3 \cdot x\right) \cdot x} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification99.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(3 - 2 \cdot x\right) \cdot \left(x \cdot x\right) \leq -5 \cdot 10^{+19}:\\ \;\;\;\;\left(x \cdot -2\right) \cdot \left(x \cdot x\right)\\ \mathbf{elif}\;\left(3 - 2 \cdot x\right) \cdot \left(x \cdot x\right) \leq 5 \cdot 10^{-8}:\\ \;\;\;\;\left(3 \cdot x\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot -2\right) \cdot \left(x \cdot x\right)\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 62.6% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \left(3 \cdot x\right) \cdot x \end{array} \]
    (FPCore (x) :precision binary64 (* (* 3.0 x) x))
    double code(double x) {
    	return (3.0 * x) * x;
    }
    
    real(8) function code(x)
        real(8), intent (in) :: x
        code = (3.0d0 * x) * x
    end function
    
    public static double code(double x) {
    	return (3.0 * x) * x;
    }
    
    def code(x):
    	return (3.0 * x) * x
    
    function code(x)
    	return Float64(Float64(3.0 * x) * x)
    end
    
    function tmp = code(x)
    	tmp = (3.0 * x) * x;
    end
    
    code[x_] := N[(N[(3.0 * x), $MachinePrecision] * x), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left(3 \cdot x\right) \cdot x
    \end{array}
    
    Derivation
    1. Initial program 99.8%

      \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{3} \]
    4. Step-by-step derivation
      1. Applied rewrites68.6%

        \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{3} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot 3} \]
        2. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot x\right)} \cdot 3 \]
        3. associate-*l*N/A

          \[\leadsto \color{blue}{x \cdot \left(x \cdot 3\right)} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{\left(x \cdot 3\right) \cdot x} \]
        5. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot 3\right) \cdot x} \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{\left(3 \cdot x\right)} \cdot x \]
        7. lower-*.f6468.6

          \[\leadsto \color{blue}{\left(3 \cdot x\right)} \cdot x \]
      3. Applied rewrites68.6%

        \[\leadsto \color{blue}{\left(3 \cdot x\right) \cdot x} \]
      4. Add Preprocessing

      Alternative 4: 62.6% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ 3 \cdot \left(x \cdot x\right) \end{array} \]
      (FPCore (x) :precision binary64 (* 3.0 (* x x)))
      double code(double x) {
      	return 3.0 * (x * x);
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          code = 3.0d0 * (x * x)
      end function
      
      public static double code(double x) {
      	return 3.0 * (x * x);
      }
      
      def code(x):
      	return 3.0 * (x * x)
      
      function code(x)
      	return Float64(3.0 * Float64(x * x))
      end
      
      function tmp = code(x)
      	tmp = 3.0 * (x * x);
      end
      
      code[x_] := N[(3.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      3 \cdot \left(x \cdot x\right)
      \end{array}
      
      Derivation
      1. Initial program 99.8%

        \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{3} \]
      4. Step-by-step derivation
        1. Applied rewrites68.6%

          \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{3} \]
        2. Final simplification68.6%

          \[\leadsto 3 \cdot \left(x \cdot x\right) \]
        3. Add Preprocessing

        Alternative 5: 3.1% accurate, 1.7× speedup?

        \[\begin{array}{l} \\ \left(9 \cdot x\right) \cdot 0.5 \end{array} \]
        (FPCore (x) :precision binary64 (* (* 9.0 x) 0.5))
        double code(double x) {
        	return (9.0 * x) * 0.5;
        }
        
        real(8) function code(x)
            real(8), intent (in) :: x
            code = (9.0d0 * x) * 0.5d0
        end function
        
        public static double code(double x) {
        	return (9.0 * x) * 0.5;
        }
        
        def code(x):
        	return (9.0 * x) * 0.5
        
        function code(x)
        	return Float64(Float64(9.0 * x) * 0.5)
        end
        
        function tmp = code(x)
        	tmp = (9.0 * x) * 0.5;
        end
        
        code[x_] := N[(N[(9.0 * x), $MachinePrecision] * 0.5), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \left(9 \cdot x\right) \cdot 0.5
        \end{array}
        
        Derivation
        1. Initial program 99.8%

          \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right)} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(3 - x \cdot 2\right) \cdot \left(x \cdot x\right)} \]
          3. lift--.f64N/A

            \[\leadsto \color{blue}{\left(3 - x \cdot 2\right)} \cdot \left(x \cdot x\right) \]
          4. flip--N/A

            \[\leadsto \color{blue}{\frac{3 \cdot 3 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)}{3 + x \cdot 2}} \cdot \left(x \cdot x\right) \]
          5. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{\left(3 \cdot 3 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)\right) \cdot \left(x \cdot x\right)}{3 + x \cdot 2}} \]
          6. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\left(3 \cdot 3 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)\right) \cdot \left(x \cdot x\right)}{3 + x \cdot 2}} \]
        4. Applied rewrites95.9%

          \[\leadsto \color{blue}{\frac{\left(\mathsf{fma}\left(-4, x \cdot x, 9\right) \cdot x\right) \cdot x}{\mathsf{fma}\left(2, x, 3\right)}} \]
        5. Taylor expanded in x around 0

          \[\leadsto \frac{\left(\color{blue}{9} \cdot x\right) \cdot x}{\mathsf{fma}\left(2, x, 3\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites50.6%

            \[\leadsto \frac{\left(\color{blue}{9} \cdot x\right) \cdot x}{\mathsf{fma}\left(2, x, 3\right)} \]
          2. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{\left(9 \cdot x\right) \cdot x}{\mathsf{fma}\left(2, x, 3\right)}} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(9 \cdot x\right) \cdot x}}{\mathsf{fma}\left(2, x, 3\right)} \]
            3. associate-/l*N/A

              \[\leadsto \color{blue}{\left(9 \cdot x\right) \cdot \frac{x}{\mathsf{fma}\left(2, x, 3\right)}} \]
            4. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(2, x, 3\right)} \cdot \left(9 \cdot x\right)} \]
            5. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(2, x, 3\right)} \cdot \left(9 \cdot x\right)} \]
            6. lower-/.f6450.7

              \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(2, x, 3\right)}} \cdot \left(9 \cdot x\right) \]
          3. Applied rewrites50.7%

            \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(2, x, 3\right)} \cdot \left(9 \cdot x\right)} \]
          4. Taylor expanded in x around inf

            \[\leadsto \color{blue}{\frac{1}{2}} \cdot \left(9 \cdot x\right) \]
          5. Step-by-step derivation
            1. Applied rewrites3.0%

              \[\leadsto \color{blue}{0.5} \cdot \left(9 \cdot x\right) \]
            2. Final simplification3.0%

              \[\leadsto \left(9 \cdot x\right) \cdot 0.5 \]
            3. Add Preprocessing

            Developer Target 1: 99.8% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right) \end{array} \]
            (FPCore (x) :precision binary64 (* x (* x (- 3.0 (* x 2.0)))))
            double code(double x) {
            	return x * (x * (3.0 - (x * 2.0)));
            }
            
            real(8) function code(x)
                real(8), intent (in) :: x
                code = x * (x * (3.0d0 - (x * 2.0d0)))
            end function
            
            public static double code(double x) {
            	return x * (x * (3.0 - (x * 2.0)));
            }
            
            def code(x):
            	return x * (x * (3.0 - (x * 2.0)))
            
            function code(x)
            	return Float64(x * Float64(x * Float64(3.0 - Float64(x * 2.0))))
            end
            
            function tmp = code(x)
            	tmp = x * (x * (3.0 - (x * 2.0)));
            end
            
            code[x_] := N[(x * N[(x * N[(3.0 - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            x \cdot \left(x \cdot \left(3 - x \cdot 2\right)\right)
            \end{array}
            

            Reproduce

            ?
            herbie shell --seed 2024295 
            (FPCore (x)
              :name "Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2"
              :precision binary64
            
              :alt
              (! :herbie-platform default (* x (* x (- 3 (* x 2)))))
            
              (* (* x x) (- 3.0 (* x 2.0))))