Data.Spline.Key:interpolateKeys from smoothie-0.4.0.2

Percentage Accurate: 99.8% → 99.8%
Time: 8.4s
Alternatives: 8
Speedup: 1.0×

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 8 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, 0.8× speedup?

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

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

    \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
  2. Step-by-step derivation
    1. associate-*l*N/A

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

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

      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
    4. sub-negN/A

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

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

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

      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
    8. metadata-eval99.8%

      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
  3. Simplified99.8%

    \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 + x \cdot -2\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. distribute-rgt-inN/A

      \[\leadsto \mathsf{*.f64}\left(x, \left(3 \cdot x + \color{blue}{\left(x \cdot -2\right) \cdot x}\right)\right) \]
    2. fma-defineN/A

      \[\leadsto \mathsf{*.f64}\left(x, \left(\mathsf{fma}\left(3, \color{blue}{x}, \left(x \cdot -2\right) \cdot x\right)\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(x, \left(\mathsf{fma}\left(3, x, \left(x \cdot \left(\mathsf{neg}\left(2\right)\right)\right) \cdot x\right)\right)\right) \]
    4. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{*.f64}\left(x, \left(\mathsf{fma}\left(3, x, \left(\mathsf{neg}\left(x \cdot 2\right)\right) \cdot x\right)\right)\right) \]
    5. distribute-lft-neg-outN/A

      \[\leadsto \mathsf{*.f64}\left(x, \left(\mathsf{fma}\left(3, x, \mathsf{neg}\left(\left(x \cdot 2\right) \cdot x\right)\right)\right)\right) \]
    6. fmm-undefN/A

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, 3\right), \left(x \cdot \color{blue}{\left(x \cdot 2\right)}\right)\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, 3\right), \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot 2\right)}\right)\right)\right) \]
    12. *-lowering-*.f6499.8%

      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, 3\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{2}\right)\right)\right)\right) \]
  6. Applied egg-rr99.8%

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

Alternative 2: 97.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := \left(x \cdot -2\right) \cdot \left(x \cdot x\right)\\
\mathbf{if}\;x \leq -1.5:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 1.5:\\
\;\;\;\;x \cdot \left(x \cdot 3\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.5 or 1.5 < x

    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 \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \color{blue}{\left(-2 \cdot x\right)}\right) \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(x \cdot \color{blue}{-2}\right)\right) \]
      2. *-lowering-*.f6499.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \color{blue}{-2}\right)\right) \]
    5. Simplified99.2%

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

    if -1.5 < x < 1.5

    1. Initial program 99.6%

      \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
    2. Step-by-step derivation
      1. associate-*l*N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
      4. sub-negN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
      8. metadata-eval99.7%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 + x \cdot -2\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0

      \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{3}\right)\right) \]
    6. Step-by-step derivation
      1. Simplified97.1%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.5:\\ \;\;\;\;\left(x \cdot -2\right) \cdot \left(x \cdot x\right)\\ \mathbf{elif}\;x \leq 1.5:\\ \;\;\;\;x \cdot \left(x \cdot 3\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot -2\right) \cdot \left(x \cdot x\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 97.6% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \frac{x}{\frac{-0.5}{x}}\\ \mathbf{if}\;x \leq -1.5:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.5:\\ \;\;\;\;x \cdot \left(x \cdot 3\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x)
     :precision binary64
     (let* ((t_0 (* x (/ x (/ -0.5 x)))))
       (if (<= x -1.5) t_0 (if (<= x 1.5) (* x (* x 3.0)) t_0))))
    double code(double x) {
    	double t_0 = x * (x / (-0.5 / x));
    	double tmp;
    	if (x <= -1.5) {
    		tmp = t_0;
    	} else if (x <= 1.5) {
    		tmp = x * (x * 3.0);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    real(8) function code(x)
        real(8), intent (in) :: x
        real(8) :: t_0
        real(8) :: tmp
        t_0 = x * (x / ((-0.5d0) / x))
        if (x <= (-1.5d0)) then
            tmp = t_0
        else if (x <= 1.5d0) then
            tmp = x * (x * 3.0d0)
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double x) {
    	double t_0 = x * (x / (-0.5 / x));
    	double tmp;
    	if (x <= -1.5) {
    		tmp = t_0;
    	} else if (x <= 1.5) {
    		tmp = x * (x * 3.0);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(x):
    	t_0 = x * (x / (-0.5 / x))
    	tmp = 0
    	if x <= -1.5:
    		tmp = t_0
    	elif x <= 1.5:
    		tmp = x * (x * 3.0)
    	else:
    		tmp = t_0
    	return tmp
    
    function code(x)
    	t_0 = Float64(x * Float64(x / Float64(-0.5 / x)))
    	tmp = 0.0
    	if (x <= -1.5)
    		tmp = t_0;
    	elseif (x <= 1.5)
    		tmp = Float64(x * Float64(x * 3.0));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x)
    	t_0 = x * (x / (-0.5 / x));
    	tmp = 0.0;
    	if (x <= -1.5)
    		tmp = t_0;
    	elseif (x <= 1.5)
    		tmp = x * (x * 3.0);
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_] := Block[{t$95$0 = N[(x * N[(x / N[(-0.5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.5], t$95$0, If[LessEqual[x, 1.5], N[(x * N[(x * 3.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x \cdot \frac{x}{\frac{-0.5}{x}}\\
    \mathbf{if}\;x \leq -1.5:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq 1.5:\\
    \;\;\;\;x \cdot \left(x \cdot 3\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -1.5 or 1.5 < x

      1. Initial program 99.9%

        \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
      2. Step-by-step derivation
        1. associate-*l*N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
        4. sub-negN/A

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

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

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

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
        8. metadata-eval99.9%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
      3. Simplified99.9%

        \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 + x \cdot -2\right)\right)} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. distribute-rgt-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(3 \cdot x + \color{blue}{\left(x \cdot -2\right) \cdot x}\right)\right) \]
        2. fma-defineN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\mathsf{fma}\left(3, \color{blue}{x}, \left(x \cdot -2\right) \cdot x\right)\right)\right) \]
        3. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\mathsf{fma}\left(3, x, \left(x \cdot \left(\mathsf{neg}\left(2\right)\right)\right) \cdot x\right)\right)\right) \]
        4. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\mathsf{fma}\left(3, x, \left(\mathsf{neg}\left(x \cdot 2\right)\right) \cdot x\right)\right)\right) \]
        5. distribute-lft-neg-outN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\mathsf{fma}\left(3, x, \mathsf{neg}\left(\left(x \cdot 2\right) \cdot x\right)\right)\right)\right) \]
        6. fmm-undefN/A

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, 3\right), \left(x \cdot \color{blue}{\left(x \cdot 2\right)}\right)\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, 3\right), \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot 2\right)}\right)\right)\right) \]
        12. *-lowering-*.f6499.9%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, 3\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{2}\right)\right)\right)\right) \]
      6. Applied egg-rr99.9%

        \[\leadsto x \cdot \color{blue}{\left(x \cdot 3 - x \cdot \left(x \cdot 2\right)\right)} \]
      7. Step-by-step derivation
        1. distribute-lft-out--N/A

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

          \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(3 - 2 \cdot \color{blue}{x}\right)\right)\right) \]
        3. cancel-sign-sub-invN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(3 + \color{blue}{\left(\mathsf{neg}\left(2\right)\right) \cdot x}\right)\right)\right) \]
        4. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(3 + -2 \cdot x\right)\right)\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \left(3 + x \cdot \color{blue}{-2}\right)\right)\right) \]
        6. /-rgt-identityN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \frac{3 + x \cdot -2}{\color{blue}{1}}\right)\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \frac{3 + x \cdot -2}{\mathsf{neg}\left(-1\right)}\right)\right) \]
        8. clear-numN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{\color{blue}{\frac{\mathsf{neg}\left(-1\right)}{3 + x \cdot -2}}}\right)\right) \]
        9. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{\frac{1}{\color{blue}{3} + x \cdot -2}}\right)\right) \]
        10. un-div-invN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{x}{\color{blue}{\frac{1}{3 + x \cdot -2}}}\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \color{blue}{\left(\frac{1}{3 + x \cdot -2}\right)}\right)\right) \]
        12. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \left(\frac{\mathsf{neg}\left(-1\right)}{\color{blue}{3} + x \cdot -2}\right)\right)\right) \]
        13. remove-double-negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(3 + x \cdot -2\right)\right)\right)\right)}\right)\right)\right) \]
        14. frac-2negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \left(\frac{-1}{\color{blue}{\mathsf{neg}\left(\left(3 + x \cdot -2\right)\right)}}\right)\right)\right) \]
        15. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(-1, \left(\mathsf{neg}\left(\left(x \cdot -2 + 3\right)\right)\right)\right)\right)\right) \]
        17. distribute-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(-1, \left(\left(\mathsf{neg}\left(x \cdot -2\right)\right) + \color{blue}{\left(\mathsf{neg}\left(3\right)\right)}\right)\right)\right)\right) \]
        18. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(-1, \left(\left(\mathsf{neg}\left(x \cdot \left(\mathsf{neg}\left(2\right)\right)\right)\right) + \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right) \]
        19. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(-1, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot 2\right)\right)\right)\right) + \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right) \]
        20. remove-double-negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(-1, \left(x \cdot 2 + \left(\mathsf{neg}\left(\color{blue}{3}\right)\right)\right)\right)\right)\right) \]
        21. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(-1, \left(x \cdot 2 + -3\right)\right)\right)\right) \]
        22. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(-1, \mathsf{+.f64}\left(\left(x \cdot 2\right), \color{blue}{-3}\right)\right)\right)\right) \]
        23. *-lowering-*.f6499.9%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(-1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, 2\right), -3\right)\right)\right)\right) \]
      8. Applied egg-rr99.9%

        \[\leadsto x \cdot \color{blue}{\frac{x}{\frac{-1}{x \cdot 2 + -3}}} \]
      9. Taylor expanded in x around inf

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \color{blue}{\left(\frac{\frac{-1}{2}}{x}\right)}\right)\right) \]
      10. Step-by-step derivation
        1. /-lowering-/.f6499.2%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(\frac{-1}{2}, \color{blue}{x}\right)\right)\right) \]
      11. Simplified99.2%

        \[\leadsto x \cdot \frac{x}{\color{blue}{\frac{-0.5}{x}}} \]

      if -1.5 < x < 1.5

      1. Initial program 99.6%

        \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
      2. Step-by-step derivation
        1. associate-*l*N/A

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

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

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
        4. sub-negN/A

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

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

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

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
        8. metadata-eval99.7%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
      3. Simplified99.7%

        \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 + x \cdot -2\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in x around 0

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{3}\right)\right) \]
      6. Step-by-step derivation
        1. Simplified97.1%

          \[\leadsto x \cdot \left(x \cdot \color{blue}{3}\right) \]
      7. Recombined 2 regimes into one program.
      8. Add Preprocessing

      Alternative 4: 75.9% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.5:\\ \;\;\;\;x \cdot \left(x \cdot 3\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{-0.3333333333333333}{x}}\\ \end{array} \end{array} \]
      (FPCore (x)
       :precision binary64
       (if (<= x 1.5) (* x (* x 3.0)) (/ x (/ -0.3333333333333333 x))))
      double code(double x) {
      	double tmp;
      	if (x <= 1.5) {
      		tmp = x * (x * 3.0);
      	} else {
      		tmp = x / (-0.3333333333333333 / x);
      	}
      	return tmp;
      }
      
      real(8) function code(x)
          real(8), intent (in) :: x
          real(8) :: tmp
          if (x <= 1.5d0) then
              tmp = x * (x * 3.0d0)
          else
              tmp = x / ((-0.3333333333333333d0) / x)
          end if
          code = tmp
      end function
      
      public static double code(double x) {
      	double tmp;
      	if (x <= 1.5) {
      		tmp = x * (x * 3.0);
      	} else {
      		tmp = x / (-0.3333333333333333 / x);
      	}
      	return tmp;
      }
      
      def code(x):
      	tmp = 0
      	if x <= 1.5:
      		tmp = x * (x * 3.0)
      	else:
      		tmp = x / (-0.3333333333333333 / x)
      	return tmp
      
      function code(x)
      	tmp = 0.0
      	if (x <= 1.5)
      		tmp = Float64(x * Float64(x * 3.0));
      	else
      		tmp = Float64(x / Float64(-0.3333333333333333 / x));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x)
      	tmp = 0.0;
      	if (x <= 1.5)
      		tmp = x * (x * 3.0);
      	else
      		tmp = x / (-0.3333333333333333 / x);
      	end
      	tmp_2 = tmp;
      end
      
      code[x_] := If[LessEqual[x, 1.5], N[(x * N[(x * 3.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq 1.5:\\
      \;\;\;\;x \cdot \left(x \cdot 3\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{\frac{-0.3333333333333333}{x}}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < 1.5

        1. Initial program 99.7%

          \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
        2. Step-by-step derivation
          1. associate-*l*N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
          4. sub-negN/A

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

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

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

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
          8. metadata-eval99.8%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 + x \cdot -2\right)\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{3}\right)\right) \]
        6. Step-by-step derivation
          1. Simplified85.0%

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

          if 1.5 < x

          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 \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \color{blue}{3}\right) \]
          4. Step-by-step derivation
            1. Simplified0.2%

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

                \[\leadsto \left(x \cdot x\right) \cdot \frac{1}{\color{blue}{\frac{1}{3}}} \]
              2. div-invN/A

                \[\leadsto \frac{x \cdot x}{\color{blue}{\frac{1}{3}}} \]
              3. associate-/l*N/A

                \[\leadsto x \cdot \color{blue}{\frac{x}{\frac{1}{3}}} \]
              4. clear-numN/A

                \[\leadsto x \cdot \frac{1}{\color{blue}{\frac{\frac{1}{3}}{x}}} \]
              5. un-div-invN/A

                \[\leadsto \frac{x}{\color{blue}{\frac{\frac{1}{3}}{x}}} \]
              6. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(\frac{\frac{1}{3}}{x}\right)}\right) \]
              7. /-lowering-/.f640.2%

                \[\leadsto \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(\frac{1}{3}, \color{blue}{x}\right)\right) \]
            3. Applied egg-rr0.2%

              \[\leadsto \color{blue}{\frac{x}{\frac{0.3333333333333333}{x}}} \]
            4. Step-by-step derivation
              1. frac-2negN/A

                \[\leadsto \mathsf{/.f64}\left(x, \left(\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{\color{blue}{\mathsf{neg}\left(x\right)}}\right)\right) \]
              2. div-invN/A

                \[\leadsto \mathsf{/.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(x\right)}}\right)\right) \]
              3. inv-powN/A

                \[\leadsto \mathsf{/.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot {\left(\mathsf{neg}\left(x\right)\right)}^{\color{blue}{-1}}\right)\right) \]
              4. sqr-powN/A

                \[\leadsto \mathsf{/.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot \left({\left(\mathsf{neg}\left(x\right)\right)}^{\left(\frac{-1}{2}\right)} \cdot \color{blue}{{\left(\mathsf{neg}\left(x\right)\right)}^{\left(\frac{-1}{2}\right)}}\right)\right)\right) \]
              5. pow-prod-downN/A

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

                \[\leadsto \mathsf{/.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot {\left(\mathsf{neg}\left(x \cdot \left(\mathsf{neg}\left(x\right)\right)\right)\right)}^{\left(\frac{\color{blue}{-1}}{2}\right)}\right)\right) \]
              7. distribute-rgt-neg-inN/A

                \[\leadsto \mathsf{/.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot {\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x \cdot x\right)\right)\right)\right)}^{\left(\frac{-1}{2}\right)}\right)\right) \]
              8. remove-double-negN/A

                \[\leadsto \mathsf{/.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot {\left(x \cdot x\right)}^{\left(\frac{\color{blue}{-1}}{2}\right)}\right)\right) \]
              9. pow-prod-downN/A

                \[\leadsto \mathsf{/.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot \left({x}^{\left(\frac{-1}{2}\right)} \cdot \color{blue}{{x}^{\left(\frac{-1}{2}\right)}}\right)\right)\right) \]
              10. sqr-powN/A

                \[\leadsto \mathsf{/.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot {x}^{\color{blue}{-1}}\right)\right) \]
              11. inv-powN/A

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

                \[\leadsto \mathsf{/.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \]
              13. div-invN/A

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

                \[\leadsto \mathsf{/.f64}\left(x, \left(\frac{\mathsf{neg}\left(\frac{1}{3}\right)}{x}\right)\right) \]
              15. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right), \color{blue}{x}\right)\right) \]
              16. metadata-eval61.8%

                \[\leadsto \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(\frac{-1}{3}, x\right)\right) \]
            5. Applied egg-rr61.8%

              \[\leadsto \frac{x}{\color{blue}{\frac{-0.3333333333333333}{x}}} \]
          5. Recombined 2 regimes into one program.
          6. Add Preprocessing

          Alternative 5: 64.3% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.5:\\ \;\;\;\;x \cdot \left(x \cdot 3\right)\\ \mathbf{else}:\\ \;\;\;\;-6.75 - x \cdot 4.5\\ \end{array} \end{array} \]
          (FPCore (x)
           :precision binary64
           (if (<= x 1.5) (* x (* x 3.0)) (- -6.75 (* x 4.5))))
          double code(double x) {
          	double tmp;
          	if (x <= 1.5) {
          		tmp = x * (x * 3.0);
          	} else {
          		tmp = -6.75 - (x * 4.5);
          	}
          	return tmp;
          }
          
          real(8) function code(x)
              real(8), intent (in) :: x
              real(8) :: tmp
              if (x <= 1.5d0) then
                  tmp = x * (x * 3.0d0)
              else
                  tmp = (-6.75d0) - (x * 4.5d0)
              end if
              code = tmp
          end function
          
          public static double code(double x) {
          	double tmp;
          	if (x <= 1.5) {
          		tmp = x * (x * 3.0);
          	} else {
          		tmp = -6.75 - (x * 4.5);
          	}
          	return tmp;
          }
          
          def code(x):
          	tmp = 0
          	if x <= 1.5:
          		tmp = x * (x * 3.0)
          	else:
          		tmp = -6.75 - (x * 4.5)
          	return tmp
          
          function code(x)
          	tmp = 0.0
          	if (x <= 1.5)
          		tmp = Float64(x * Float64(x * 3.0));
          	else
          		tmp = Float64(-6.75 - Float64(x * 4.5));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x)
          	tmp = 0.0;
          	if (x <= 1.5)
          		tmp = x * (x * 3.0);
          	else
          		tmp = -6.75 - (x * 4.5);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_] := If[LessEqual[x, 1.5], N[(x * N[(x * 3.0), $MachinePrecision]), $MachinePrecision], N[(-6.75 - N[(x * 4.5), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq 1.5:\\
          \;\;\;\;x \cdot \left(x \cdot 3\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;-6.75 - x \cdot 4.5\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < 1.5

            1. Initial program 99.7%

              \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
            2. Step-by-step derivation
              1. associate-*l*N/A

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

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

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
              4. sub-negN/A

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

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

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

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
              8. metadata-eval99.8%

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
            3. Simplified99.8%

              \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 + x \cdot -2\right)\right)} \]
            4. Add Preprocessing
            5. Taylor expanded in x around 0

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{3}\right)\right) \]
            6. Step-by-step derivation
              1. Simplified85.0%

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

              if 1.5 < x

              1. Initial program 99.9%

                \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
              2. Step-by-step derivation
                1. associate-*l*N/A

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

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

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
                4. sub-negN/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
                8. metadata-eval99.9%

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
              3. Simplified99.9%

                \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 + x \cdot -2\right)\right)} \]
              4. Add Preprocessing
              5. Applied egg-rr0.2%

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

                \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \color{blue}{\left(9 \cdot x\right)}\right), \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right) \]
              7. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot 9\right)\right), \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right) \]
                2. *-lowering-*.f6460.7%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, 9\right)\right), \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right) \]
              8. Simplified60.7%

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

                \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(\frac{9}{2} + \frac{27}{4} \cdot \frac{1}{x}\right)\right)} \]
              10. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \mathsf{neg}\left(x \cdot \left(\frac{9}{2} + \frac{27}{4} \cdot \frac{1}{x}\right)\right) \]
                2. distribute-rgt-inN/A

                  \[\leadsto \mathsf{neg}\left(\left(\frac{9}{2} \cdot x + \left(\frac{27}{4} \cdot \frac{1}{x}\right) \cdot x\right)\right) \]
                3. distribute-neg-inN/A

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

                  \[\leadsto \left(\mathsf{neg}\left(\left(\frac{27}{4} \cdot \frac{1}{x}\right) \cdot x\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{9}{2} \cdot x\right)\right)} \]
                5. sub-negN/A

                  \[\leadsto \left(\mathsf{neg}\left(\left(\frac{27}{4} \cdot \frac{1}{x}\right) \cdot x\right)\right) - \color{blue}{\frac{9}{2} \cdot x} \]
                6. --lowering--.f64N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\frac{27}{4} \cdot \frac{1}{x}\right) \cdot x\right)\right), \color{blue}{\left(\frac{9}{2} \cdot x\right)}\right) \]
                7. associate-*l*N/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{27}{4} \cdot \left(\frac{1}{x} \cdot x\right)\right)\right), \left(\frac{9}{2} \cdot x\right)\right) \]
                8. lft-mult-inverseN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{27}{4} \cdot 1\right)\right), \left(\frac{9}{2} \cdot x\right)\right) \]
                9. metadata-evalN/A

                  \[\leadsto \mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{27}{4}\right)\right), \left(\frac{9}{2} \cdot x\right)\right) \]
                10. metadata-evalN/A

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

                  \[\leadsto \mathsf{\_.f64}\left(\frac{-27}{4}, \left(x \cdot \color{blue}{\frac{9}{2}}\right)\right) \]
                12. *-lowering-*.f646.8%

                  \[\leadsto \mathsf{\_.f64}\left(\frac{-27}{4}, \mathsf{*.f64}\left(x, \color{blue}{\frac{9}{2}}\right)\right) \]
              11. Simplified6.8%

                \[\leadsto \color{blue}{-6.75 - x \cdot 4.5} \]
            7. Recombined 2 regimes into one program.
            8. Add Preprocessing

            Alternative 6: 64.3% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.5:\\ \;\;\;\;x \cdot \left(x \cdot 3\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot -4.5\\ \end{array} \end{array} \]
            (FPCore (x) :precision binary64 (if (<= x 1.5) (* x (* x 3.0)) (* x -4.5)))
            double code(double x) {
            	double tmp;
            	if (x <= 1.5) {
            		tmp = x * (x * 3.0);
            	} else {
            		tmp = x * -4.5;
            	}
            	return tmp;
            }
            
            real(8) function code(x)
                real(8), intent (in) :: x
                real(8) :: tmp
                if (x <= 1.5d0) then
                    tmp = x * (x * 3.0d0)
                else
                    tmp = x * (-4.5d0)
                end if
                code = tmp
            end function
            
            public static double code(double x) {
            	double tmp;
            	if (x <= 1.5) {
            		tmp = x * (x * 3.0);
            	} else {
            		tmp = x * -4.5;
            	}
            	return tmp;
            }
            
            def code(x):
            	tmp = 0
            	if x <= 1.5:
            		tmp = x * (x * 3.0)
            	else:
            		tmp = x * -4.5
            	return tmp
            
            function code(x)
            	tmp = 0.0
            	if (x <= 1.5)
            		tmp = Float64(x * Float64(x * 3.0));
            	else
            		tmp = Float64(x * -4.5);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x)
            	tmp = 0.0;
            	if (x <= 1.5)
            		tmp = x * (x * 3.0);
            	else
            		tmp = x * -4.5;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_] := If[LessEqual[x, 1.5], N[(x * N[(x * 3.0), $MachinePrecision]), $MachinePrecision], N[(x * -4.5), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq 1.5:\\
            \;\;\;\;x \cdot \left(x \cdot 3\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot -4.5\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < 1.5

              1. Initial program 99.7%

                \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
              2. Step-by-step derivation
                1. associate-*l*N/A

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

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

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
                4. sub-negN/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
                8. metadata-eval99.8%

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
              3. Simplified99.8%

                \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 + x \cdot -2\right)\right)} \]
              4. Add Preprocessing
              5. Taylor expanded in x around 0

                \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{3}\right)\right) \]
              6. Step-by-step derivation
                1. Simplified85.0%

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

                if 1.5 < x

                1. Initial program 99.9%

                  \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
                2. Step-by-step derivation
                  1. associate-*l*N/A

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

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

                    \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
                  4. sub-negN/A

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
                  8. metadata-eval99.9%

                    \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
                3. Simplified99.9%

                  \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 + x \cdot -2\right)\right)} \]
                4. Add Preprocessing
                5. Applied egg-rr0.2%

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \color{blue}{\left(9 \cdot x\right)}\right), \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right) \]
                7. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot 9\right)\right), \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right) \]
                  2. *-lowering-*.f6460.7%

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, 9\right)\right), \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right) \]
                8. Simplified60.7%

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

                  \[\leadsto \color{blue}{\frac{-9}{2} \cdot x} \]
                10. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto x \cdot \color{blue}{\frac{-9}{2}} \]
                  2. *-lowering-*.f646.8%

                    \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\frac{-9}{2}}\right) \]
                11. Simplified6.8%

                  \[\leadsto \color{blue}{x \cdot -4.5} \]
              7. Recombined 2 regimes into one program.
              8. Add Preprocessing

              Alternative 7: 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}
              
              Derivation
              1. Initial program 99.8%

                \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
              2. Step-by-step derivation
                1. associate-*l*N/A

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

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

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
                4. sub-negN/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
                8. metadata-eval99.8%

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
              3. Simplified99.8%

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

              Alternative 8: 6.2% accurate, 3.0× speedup?

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

                \[\left(x \cdot x\right) \cdot \left(3 - x \cdot 2\right) \]
              2. Step-by-step derivation
                1. associate-*l*N/A

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

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

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(3 - x \cdot 2\right)}\right)\right) \]
                4. sub-negN/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right)\right) \]
                8. metadata-eval99.8%

                  \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right)\right) \]
              3. Simplified99.8%

                \[\leadsto \color{blue}{x \cdot \left(x \cdot \left(3 + x \cdot -2\right)\right)} \]
              4. Add Preprocessing
              5. Applied egg-rr48.6%

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

                \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \color{blue}{\left(9 \cdot x\right)}\right), \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right) \]
              7. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot 9\right)\right), \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right) \]
                2. *-lowering-*.f6478.5%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, 9\right)\right), \mathsf{+.f64}\left(3, \mathsf{*.f64}\left(x, -2\right)\right)\right) \]
              8. Simplified78.5%

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

                \[\leadsto \color{blue}{\frac{-9}{2} \cdot x} \]
              10. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto x \cdot \color{blue}{\frac{-9}{2}} \]
                2. *-lowering-*.f646.2%

                  \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\frac{-9}{2}}\right) \]
              11. Simplified6.2%

                \[\leadsto \color{blue}{x \cdot -4.5} \]
              12. 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 2024160 
              (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))))