Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2

Percentage Accurate: 99.8% → 99.8%
Time: 8.9s
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} \\ \mathsf{fma}\left(x, -2, 3\right) \cdot \left(x \cdot x\right) \end{array} \]
(FPCore (x) :precision binary64 (* (fma x -2.0 3.0) (* x x)))
double code(double x) {
	return fma(x, -2.0, 3.0) * (x * x);
}
function code(x)
	return Float64(fma(x, -2.0, 3.0) * Float64(x * x))
end
code[x_] := N[(N[(x * -2.0 + 3.0), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[\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. lower-*.f6499.9

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

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

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

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

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

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

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

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

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

Alternative 2: 97.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 0.2:\\
\;\;\;\;\left(x \cdot x\right) \cdot 3\\

\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)))) < -2e18 or 0.20000000000000001 < (*.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-*.f6498.1

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

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

    if -2e18 < (*.f64 (*.f64 x x) (-.f64 #s(literal 3 binary64) (*.f64 x #s(literal 2 binary64)))) < 0.20000000000000001

    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 0

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

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

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

    Alternative 3: 99.8% accurate, 1.1× speedup?

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

      \[\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. lower-*.f6499.8

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot \mathsf{fma}\left(x, -2, 3\right)\right) \cdot x} \]
    5. Final simplification99.8%

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

    Alternative 4: 62.3% accurate, 1.7× speedup?

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

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

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

      Alternative 5: 62.3% accurate, 1.7× speedup?

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

        \[\leadsto \color{blue}{3 \cdot {x}^{2}} \]
      4. Step-by-step derivation
        1. metadata-evalN/A

          \[\leadsto \color{blue}{\left(1 \cdot 3\right)} \cdot {x}^{2} \]
        2. lft-mult-inverseN/A

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

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

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

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

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

          \[\leadsto \color{blue}{x \cdot \left(\left(3 \cdot \frac{1}{x}\right) \cdot {x}^{2}\right)} \]
        8. unpow2N/A

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

          \[\leadsto x \cdot \color{blue}{\left(\left(\left(3 \cdot \frac{1}{x}\right) \cdot x\right) \cdot x\right)} \]
        10. remove-double-negN/A

          \[\leadsto x \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(3 \cdot \frac{1}{x}\right) \cdot x\right)\right)\right)\right)} \cdot x\right) \]
        11. distribute-lft-neg-outN/A

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

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

          \[\leadsto x \cdot \left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) \cdot \left(\mathsf{neg}\left(3 \cdot \frac{1}{x}\right)\right)\right)} \cdot x\right) \]
        14. mul-1-negN/A

          \[\leadsto x \cdot \left(\left(\color{blue}{\left(-1 \cdot x\right)} \cdot \left(\mathsf{neg}\left(3 \cdot \frac{1}{x}\right)\right)\right) \cdot x\right) \]
        15. *-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(x \cdot \left(\left(-1 \cdot x\right) \cdot \left(\mathsf{neg}\left(3 \cdot \frac{1}{x}\right)\right)\right)\right)} \]
        16. lower-*.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(x \cdot \left(\left(-1 \cdot x\right) \cdot \left(\mathsf{neg}\left(3 \cdot \frac{1}{x}\right)\right)\right)\right)} \]
        17. *-commutativeN/A

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

          \[\leadsto x \cdot \left(x \cdot \left(\left(-1 \cdot x\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{x}\right)\right) \cdot 3\right)}\right)\right) \]
        19. associate-*r*N/A

          \[\leadsto x \cdot \left(x \cdot \color{blue}{\left(\left(\left(-1 \cdot x\right) \cdot \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)\right) \cdot 3\right)}\right) \]
      5. Applied rewrites63.8%

        \[\leadsto \color{blue}{x \cdot \left(x \cdot 3\right)} \]
      6. 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 2024233 
      (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))))