Rosa's Benchmark

Percentage Accurate: 99.8% → 99.8%
Time: 7.4s
Alternatives: 7
Speedup: 1.2×

Specification

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

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

\\
0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right)
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

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

\\
0.954929658551372 \cdot x - \left(x \cdot x\right) \cdot \left(x \cdot 0.12900613773279798\right)
\end{array}
Derivation
  1. Initial program 99.5%

    \[0.954929658551372 \cdot x - 0.12900613773279798 \cdot \left(\left(x \cdot x\right) \cdot x\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{238732414637843}{250000000000000}, x\right), \left(\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{x}\right)\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{238732414637843}{250000000000000}, x\right), \left(\left(\left(x \cdot x\right) \cdot \frac{6450306886639899}{50000000000000000}\right) \cdot x\right)\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{238732414637843}{250000000000000}, x\right), \left(\left(x \cdot x\right) \cdot \color{blue}{\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)}\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{238732414637843}{250000000000000}, x\right), \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{238732414637843}{250000000000000}, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{\frac{6450306886639899}{50000000000000000}} \cdot x\right)\right)\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{238732414637843}{250000000000000}, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(x \cdot \color{blue}{\frac{6450306886639899}{50000000000000000}}\right)\right)\right) \]
    7. *-lowering-*.f6499.9%

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{238732414637843}{250000000000000}, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \color{blue}{\frac{6450306886639899}{50000000000000000}}\right)\right)\right) \]
  4. Applied egg-rr99.9%

    \[\leadsto 0.954929658551372 \cdot x - \color{blue}{\left(x \cdot x\right) \cdot \left(x \cdot 0.12900613773279798\right)} \]
  5. Add Preprocessing

Alternative 2: 74.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.8:\\ \;\;\;\;0.954929658551372 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot -0.12900613773279798\right)\\ \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (if (<= x 2.8)
   (* 0.954929658551372 x)
   (* (* x x) (* x -0.12900613773279798))))
double code(double x) {
	double tmp;
	if (x <= 2.8) {
		tmp = 0.954929658551372 * x;
	} else {
		tmp = (x * x) * (x * -0.12900613773279798);
	}
	return tmp;
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: tmp
    if (x <= 2.8d0) then
        tmp = 0.954929658551372d0 * x
    else
        tmp = (x * x) * (x * (-0.12900613773279798d0))
    end if
    code = tmp
end function
public static double code(double x) {
	double tmp;
	if (x <= 2.8) {
		tmp = 0.954929658551372 * x;
	} else {
		tmp = (x * x) * (x * -0.12900613773279798);
	}
	return tmp;
}
def code(x):
	tmp = 0
	if x <= 2.8:
		tmp = 0.954929658551372 * x
	else:
		tmp = (x * x) * (x * -0.12900613773279798)
	return tmp
function code(x)
	tmp = 0.0
	if (x <= 2.8)
		tmp = Float64(0.954929658551372 * x);
	else
		tmp = Float64(Float64(x * x) * Float64(x * -0.12900613773279798));
	end
	return tmp
end
function tmp_2 = code(x)
	tmp = 0.0;
	if (x <= 2.8)
		tmp = 0.954929658551372 * x;
	else
		tmp = (x * x) * (x * -0.12900613773279798);
	end
	tmp_2 = tmp;
end
code[x_] := If[LessEqual[x, 2.8], N[(0.954929658551372 * x), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * -0.12900613773279798), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8:\\
\;\;\;\;0.954929658551372 \cdot x\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot -0.12900613773279798\right)\\


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

    1. Initial program 99.4%

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

        \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{x} \]
      2. distribute-rgt-out--N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)}\right) \]
      4. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{238732414637843}{250000000000000} + \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(\left(\frac{6450306886639899}{50000000000000000} \cdot x\right) \cdot x\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(x \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)\right)\right)\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
      10. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \color{blue}{x}\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
      13. metadata-eval99.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{-6450306886639899}{50000000000000000}\right)\right)\right)\right) \]
    3. Simplified99.8%

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

      \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\frac{238732414637843}{250000000000000}}\right) \]
    6. Step-by-step derivation
      1. Simplified62.5%

        \[\leadsto x \cdot \color{blue}{0.954929658551372} \]

      if 2.7999999999999998 < x

      1. Initial program 99.9%

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

          \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{x} \]
        2. distribute-rgt-out--N/A

          \[\leadsto x \cdot \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)}\right) \]
        4. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{238732414637843}{250000000000000} + \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
        6. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(\left(\frac{6450306886639899}{50000000000000000} \cdot x\right) \cdot x\right)\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(x \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)\right)\right)\right) \]
        8. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
        10. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \color{blue}{x}\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
        13. metadata-eval99.8%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{-6450306886639899}{50000000000000000}\right)\right)\right)\right) \]
      3. Simplified99.8%

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

        \[\leadsto \color{blue}{\frac{-6450306886639899}{50000000000000000} \cdot {x}^{3}} \]
      6. Step-by-step derivation
        1. unpow3N/A

          \[\leadsto \frac{-6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{x}\right) \]
        2. unpow2N/A

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

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

          \[\leadsto x \cdot \color{blue}{\left(\frac{-6450306886639899}{50000000000000000} \cdot {x}^{2}\right)} \]
        5. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{-6450306886639899}{50000000000000000}, \color{blue}{\left({x}^{2}\right)}\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{-6450306886639899}{50000000000000000}, \left(x \cdot \color{blue}{x}\right)\right)\right) \]
        8. *-lowering-*.f6498.2%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{-6450306886639899}{50000000000000000}, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
      7. Simplified98.2%

        \[\leadsto \color{blue}{x \cdot \left(-0.12900613773279798 \cdot \left(x \cdot x\right)\right)} \]
      8. Step-by-step derivation
        1. *-commutativeN/A

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

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

          \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{\left(\frac{-6450306886639899}{50000000000000000} \cdot x\right)} \]
        4. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{\frac{-6450306886639899}{50000000000000000}} \cdot x\right)\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(x \cdot \color{blue}{\frac{-6450306886639899}{50000000000000000}}\right)\right) \]
        7. *-lowering-*.f6498.2%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(x, \color{blue}{\frac{-6450306886639899}{50000000000000000}}\right)\right) \]
      9. Applied egg-rr98.2%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.8:\\ \;\;\;\;0.954929658551372 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot -0.12900613773279798\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 74.8% accurate, 0.9× speedup?

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

      1. Initial program 99.4%

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

          \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{x} \]
        2. distribute-rgt-out--N/A

          \[\leadsto x \cdot \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)}\right) \]
        4. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{238732414637843}{250000000000000} + \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
        6. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(\left(\frac{6450306886639899}{50000000000000000} \cdot x\right) \cdot x\right)\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(x \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)\right)\right)\right) \]
        8. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
        10. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \color{blue}{x}\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
        13. metadata-eval99.8%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{-6450306886639899}{50000000000000000}\right)\right)\right)\right) \]
      3. Simplified99.8%

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\frac{238732414637843}{250000000000000}}\right) \]
      6. Step-by-step derivation
        1. Simplified62.5%

          \[\leadsto x \cdot \color{blue}{0.954929658551372} \]

        if 2.7999999999999998 < x

        1. Initial program 99.9%

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

            \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{x} \]
          2. distribute-rgt-out--N/A

            \[\leadsto x \cdot \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)}\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{238732414637843}{250000000000000} + \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(\left(\frac{6450306886639899}{50000000000000000} \cdot x\right) \cdot x\right)\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(x \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
          10. distribute-lft-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \color{blue}{x}\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
          13. metadata-eval99.8%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{-6450306886639899}{50000000000000000}\right)\right)\right)\right) \]
        3. Simplified99.8%

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

          \[\leadsto \color{blue}{\frac{-6450306886639899}{50000000000000000} \cdot {x}^{3}} \]
        6. Step-by-step derivation
          1. unpow3N/A

            \[\leadsto \frac{-6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot \color{blue}{x}\right) \]
          2. unpow2N/A

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

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

            \[\leadsto x \cdot \color{blue}{\left(\frac{-6450306886639899}{50000000000000000} \cdot {x}^{2}\right)} \]
          5. *-lowering-*.f64N/A

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

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{-6450306886639899}{50000000000000000}, \color{blue}{\left({x}^{2}\right)}\right)\right) \]
          7. unpow2N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{-6450306886639899}{50000000000000000}, \left(x \cdot \color{blue}{x}\right)\right)\right) \]
          8. *-lowering-*.f6498.2%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{-6450306886639899}{50000000000000000}, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
        7. Simplified98.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.8:\\ \;\;\;\;0.954929658551372 \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(x \cdot x\right) \cdot -0.12900613773279798\right)\\ \end{array} \]
      9. Add Preprocessing

      Alternative 4: 99.8% accurate, 1.2× speedup?

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

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

          \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{x} \]
        2. distribute-rgt-out--N/A

          \[\leadsto x \cdot \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)}\right) \]
        4. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{238732414637843}{250000000000000} + \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
        6. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(\left(\frac{6450306886639899}{50000000000000000} \cdot x\right) \cdot x\right)\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(x \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)\right)\right)\right) \]
        8. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
        10. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \color{blue}{x}\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
        13. metadata-eval99.8%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{-6450306886639899}{50000000000000000}\right)\right)\right)\right) \]
      3. Simplified99.8%

        \[\leadsto \color{blue}{x \cdot \left(0.954929658551372 + x \cdot \left(x \cdot -0.12900613773279798\right)\right)} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\frac{238732414637843}{250000000000000} + x \cdot \left(x \cdot \frac{-6450306886639899}{50000000000000000}\right)\right) \cdot \color{blue}{x} \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\left(\frac{238732414637843}{250000000000000} + x \cdot \left(x \cdot \frac{-6450306886639899}{50000000000000000}\right)\right), \color{blue}{x}\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(x \cdot \left(x \cdot \frac{-6450306886639899}{50000000000000000}\right)\right)\right), x\right) \]
        4. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\left(x \cdot x\right) \cdot \frac{-6450306886639899}{50000000000000000}\right)\right), x\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\frac{-6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right), x\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(\frac{-6450306886639899}{50000000000000000}, \left(x \cdot x\right)\right)\right), x\right) \]
        7. *-lowering-*.f6499.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(\frac{-6450306886639899}{50000000000000000}, \mathsf{*.f64}\left(x, x\right)\right)\right), x\right) \]
      6. Applied egg-rr99.8%

        \[\leadsto \color{blue}{\left(0.954929658551372 + -0.12900613773279798 \cdot \left(x \cdot x\right)\right) \cdot x} \]
      7. Final simplification99.8%

        \[\leadsto x \cdot \left(0.954929658551372 + \left(x \cdot x\right) \cdot -0.12900613773279798\right) \]
      8. Add Preprocessing

      Alternative 5: 99.8% accurate, 1.2× speedup?

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

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

          \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{x} \]
        2. distribute-rgt-out--N/A

          \[\leadsto x \cdot \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)}\right) \]
        4. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{238732414637843}{250000000000000} + \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
        6. associate-*r*N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(\left(\frac{6450306886639899}{50000000000000000} \cdot x\right) \cdot x\right)\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(x \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)\right)\right)\right) \]
        8. distribute-rgt-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
        10. distribute-lft-neg-inN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \color{blue}{x}\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
        12. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
        13. metadata-eval99.8%

          \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{-6450306886639899}{50000000000000000}\right)\right)\right)\right) \]
      3. Simplified99.8%

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

      Alternative 6: 51.3% accurate, 1.4× speedup?

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

        1. Initial program 99.4%

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

            \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{x} \]
          2. distribute-rgt-out--N/A

            \[\leadsto x \cdot \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)}\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{238732414637843}{250000000000000} + \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(\left(\frac{6450306886639899}{50000000000000000} \cdot x\right) \cdot x\right)\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(x \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
          10. distribute-lft-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \color{blue}{x}\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
          13. metadata-eval99.8%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{-6450306886639899}{50000000000000000}\right)\right)\right)\right) \]
        3. Simplified99.8%

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

          \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\frac{238732414637843}{250000000000000}}\right) \]
        6. Step-by-step derivation
          1. Simplified62.5%

            \[\leadsto x \cdot \color{blue}{0.954929658551372} \]

          if 2.7999999999999998 < x

          1. Initial program 99.9%

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

              \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{x} \]
            2. distribute-rgt-out--N/A

              \[\leadsto x \cdot \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)} \]
            3. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)}\right) \]
            4. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{238732414637843}{250000000000000} + \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
            5. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
            6. associate-*r*N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(\left(\frac{6450306886639899}{50000000000000000} \cdot x\right) \cdot x\right)\right)\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(x \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)\right)\right)\right) \]
            8. distribute-rgt-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
            9. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
            10. distribute-lft-neg-inN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \color{blue}{x}\right)\right)\right)\right) \]
            11. *-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
            12. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
            13. metadata-eval99.8%

              \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{-6450306886639899}{50000000000000000}\right)\right)\right)\right) \]
          3. Simplified99.8%

            \[\leadsto \color{blue}{x \cdot \left(0.954929658551372 + x \cdot \left(x \cdot -0.12900613773279798\right)\right)} \]
          4. Add Preprocessing
          5. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto x \cdot \left(\frac{238732414637843}{250000000000000} + \left(x \cdot x\right) \cdot \color{blue}{\frac{-6450306886639899}{50000000000000000}}\right) \]
            2. *-commutativeN/A

              \[\leadsto x \cdot \left(\frac{238732414637843}{250000000000000} + \frac{-6450306886639899}{50000000000000000} \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
            3. metadata-evalN/A

              \[\leadsto x \cdot \left(\frac{238732414637843}{250000000000000} + \left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \left(\color{blue}{x} \cdot x\right)\right) \]
            4. cancel-sign-sub-invN/A

              \[\leadsto x \cdot \left(\frac{238732414637843}{250000000000000} - \color{blue}{\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)}\right) \]
            5. distribute-rgt-out--N/A

              \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \color{blue}{\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot x} \]
            6. associate-*r*N/A

              \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \frac{6450306886639899}{50000000000000000} \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} \]
            7. flip--N/A

              \[\leadsto \frac{\left(\frac{238732414637843}{250000000000000} \cdot x\right) \cdot \left(\frac{238732414637843}{250000000000000} \cdot x\right) - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}{\color{blue}{\frac{238732414637843}{250000000000000} \cdot x + \frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)}} \]
            8. clear-numN/A

              \[\leadsto \frac{1}{\color{blue}{\frac{\frac{238732414637843}{250000000000000} \cdot x + \frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)}{\left(\frac{238732414637843}{250000000000000} \cdot x\right) \cdot \left(\frac{238732414637843}{250000000000000} \cdot x\right) - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}}} \]
            9. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\frac{238732414637843}{250000000000000} \cdot x + \frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)}{\left(\frac{238732414637843}{250000000000000} \cdot x\right) \cdot \left(\frac{238732414637843}{250000000000000} \cdot x\right) - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}\right)}\right) \]
            10. clear-numN/A

              \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\color{blue}{\frac{\left(\frac{238732414637843}{250000000000000} \cdot x\right) \cdot \left(\frac{238732414637843}{250000000000000} \cdot x\right) - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}{\frac{238732414637843}{250000000000000} \cdot x + \frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)}}}\right)\right) \]
            11. flip--N/A

              \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\frac{238732414637843}{250000000000000} \cdot x - \color{blue}{\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)}}\right)\right) \]
            12. fmm-defN/A

              \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\mathsf{fma}\left(\frac{238732414637843}{250000000000000}, \color{blue}{x}, \mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right)}\right)\right) \]
            13. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\mathsf{fma}\left(\frac{238732414637843}{250000000000000}, x, \mathsf{neg}\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right) \]
          6. Applied egg-rr99.9%

            \[\leadsto \color{blue}{\frac{1}{\frac{1}{x \cdot \left(0.954929658551372 + -0.12900613773279798 \cdot \left(x \cdot x\right)\right)}}} \]
          7. Taylor expanded in x around 0

            \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\frac{250000000000000}{238732414637843}}{x}\right)}\right) \]
          8. Step-by-step derivation
            1. /-lowering-/.f640.4%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\frac{250000000000000}{238732414637843}, \color{blue}{x}\right)\right) \]
          9. Simplified0.4%

            \[\leadsto \frac{1}{\color{blue}{\frac{1.0471975511965979}{x}}} \]
          10. Step-by-step derivation
            1. clear-numN/A

              \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{x}{\frac{250000000000000}{238732414637843}}}}} \]
            2. associate-/r/N/A

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

              \[\leadsto \frac{\frac{1}{\frac{1}{x}}}{\color{blue}{\frac{250000000000000}{238732414637843}}} \]
            4. inv-powN/A

              \[\leadsto \frac{{\left(\frac{1}{x}\right)}^{-1}}{\frac{250000000000000}{238732414637843}} \]
            5. sqr-powN/A

              \[\leadsto \frac{{\left(\frac{1}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{1}{x}\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
            6. pow-prod-downN/A

              \[\leadsto \frac{{\left(\frac{1}{x} \cdot \frac{1}{x}\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
            7. sqr-negN/A

              \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{1}{x}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
            8. mul-1-negN/A

              \[\leadsto \frac{{\left(\left(-1 \cdot \frac{1}{x}\right) \cdot \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
            9. div-invN/A

              \[\leadsto \frac{{\left(\frac{-1}{x} \cdot \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
            10. mul-1-negN/A

              \[\leadsto \frac{{\left(\frac{-1}{x} \cdot \left(-1 \cdot \frac{1}{x}\right)\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
            11. div-invN/A

              \[\leadsto \frac{{\left(\frac{-1}{x} \cdot \frac{-1}{x}\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
            12. pow-prod-downN/A

              \[\leadsto \frac{{\left(\frac{-1}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{-1}{x}\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
            13. sqr-powN/A

              \[\leadsto \frac{{\left(\frac{-1}{x}\right)}^{-1}}{\frac{250000000000000}{238732414637843}} \]
            14. inv-powN/A

              \[\leadsto \frac{\frac{1}{\frac{-1}{x}}}{\frac{250000000000000}{238732414637843}} \]
            15. frac-2negN/A

              \[\leadsto \frac{\frac{1}{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(x\right)}}}{\frac{250000000000000}{238732414637843}} \]
            16. metadata-evalN/A

              \[\leadsto \frac{\frac{1}{\frac{1}{\mathsf{neg}\left(x\right)}}}{\frac{250000000000000}{238732414637843}} \]
            17. remove-double-divN/A

              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\frac{250000000000000}{238732414637843}} \]
            18. distribute-neg-fracN/A

              \[\leadsto \mathsf{neg}\left(\frac{x}{\frac{250000000000000}{238732414637843}}\right) \]
            19. div-invN/A

              \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{250000000000000}{238732414637843}}\right) \]
            20. distribute-rgt-neg-inN/A

              \[\leadsto x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{\frac{250000000000000}{238732414637843}}\right)\right)} \]
            21. metadata-evalN/A

              \[\leadsto x \cdot \left(\mathsf{neg}\left(\frac{238732414637843}{250000000000000}\right)\right) \]
            22. metadata-evalN/A

              \[\leadsto x \cdot \frac{-238732414637843}{250000000000000} \]
            23. *-lowering-*.f646.2%

              \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\frac{-238732414637843}{250000000000000}}\right) \]
          11. Applied egg-rr6.2%

            \[\leadsto \color{blue}{x \cdot -0.954929658551372} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification47.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.8:\\ \;\;\;\;0.954929658551372 \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot -0.954929658551372\\ \end{array} \]
        9. Add Preprocessing

        Alternative 7: 5.1% accurate, 3.7× speedup?

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

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

            \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot \color{blue}{x} \]
          2. distribute-rgt-out--N/A

            \[\leadsto x \cdot \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{238732414637843}{250000000000000} - \frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)}\right) \]
          4. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{238732414637843}{250000000000000} + \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right)\right)}\right)\right) \]
          6. associate-*r*N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(\left(\frac{6450306886639899}{50000000000000000} \cdot x\right) \cdot x\right)\right)\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(\mathsf{neg}\left(x \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)\right)\right)\right) \]
          8. distribute-rgt-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot x\right)\right)}\right)\right)\right) \]
          10. distribute-lft-neg-inN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \color{blue}{x}\right)\right)\right)\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right)\right)\right) \]
          13. metadata-eval99.8%

            \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{238732414637843}{250000000000000}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{-6450306886639899}{50000000000000000}\right)\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{x \cdot \left(0.954929658551372 + x \cdot \left(x \cdot -0.12900613773279798\right)\right)} \]
        4. Add Preprocessing
        5. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto x \cdot \left(\frac{238732414637843}{250000000000000} + \left(x \cdot x\right) \cdot \color{blue}{\frac{-6450306886639899}{50000000000000000}}\right) \]
          2. *-commutativeN/A

            \[\leadsto x \cdot \left(\frac{238732414637843}{250000000000000} + \frac{-6450306886639899}{50000000000000000} \cdot \color{blue}{\left(x \cdot x\right)}\right) \]
          3. metadata-evalN/A

            \[\leadsto x \cdot \left(\frac{238732414637843}{250000000000000} + \left(\mathsf{neg}\left(\frac{6450306886639899}{50000000000000000}\right)\right) \cdot \left(\color{blue}{x} \cdot x\right)\right) \]
          4. cancel-sign-sub-invN/A

            \[\leadsto x \cdot \left(\frac{238732414637843}{250000000000000} - \color{blue}{\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)}\right) \]
          5. distribute-rgt-out--N/A

            \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \color{blue}{\left(\frac{6450306886639899}{50000000000000000} \cdot \left(x \cdot x\right)\right) \cdot x} \]
          6. associate-*r*N/A

            \[\leadsto \frac{238732414637843}{250000000000000} \cdot x - \frac{6450306886639899}{50000000000000000} \cdot \color{blue}{\left(\left(x \cdot x\right) \cdot x\right)} \]
          7. flip--N/A

            \[\leadsto \frac{\left(\frac{238732414637843}{250000000000000} \cdot x\right) \cdot \left(\frac{238732414637843}{250000000000000} \cdot x\right) - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}{\color{blue}{\frac{238732414637843}{250000000000000} \cdot x + \frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)}} \]
          8. clear-numN/A

            \[\leadsto \frac{1}{\color{blue}{\frac{\frac{238732414637843}{250000000000000} \cdot x + \frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)}{\left(\frac{238732414637843}{250000000000000} \cdot x\right) \cdot \left(\frac{238732414637843}{250000000000000} \cdot x\right) - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}}} \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\frac{238732414637843}{250000000000000} \cdot x + \frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)}{\left(\frac{238732414637843}{250000000000000} \cdot x\right) \cdot \left(\frac{238732414637843}{250000000000000} \cdot x\right) - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}\right)}\right) \]
          10. clear-numN/A

            \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\color{blue}{\frac{\left(\frac{238732414637843}{250000000000000} \cdot x\right) \cdot \left(\frac{238732414637843}{250000000000000} \cdot x\right) - \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) \cdot \left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)}{\frac{238732414637843}{250000000000000} \cdot x + \frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)}}}\right)\right) \]
          11. flip--N/A

            \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\frac{238732414637843}{250000000000000} \cdot x - \color{blue}{\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)}}\right)\right) \]
          12. fmm-defN/A

            \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\mathsf{fma}\left(\frac{238732414637843}{250000000000000}, \color{blue}{x}, \mathsf{neg}\left(\frac{6450306886639899}{50000000000000000} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right)}\right)\right) \]
          13. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\mathsf{fma}\left(\frac{238732414637843}{250000000000000}, x, \mathsf{neg}\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot \frac{6450306886639899}{50000000000000000}\right)\right)}\right)\right) \]
        6. Applied egg-rr99.7%

          \[\leadsto \color{blue}{\frac{1}{\frac{1}{x \cdot \left(0.954929658551372 + -0.12900613773279798 \cdot \left(x \cdot x\right)\right)}}} \]
        7. Taylor expanded in x around 0

          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\frac{250000000000000}{238732414637843}}{x}\right)}\right) \]
        8. Step-by-step derivation
          1. /-lowering-/.f6445.4%

            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\frac{250000000000000}{238732414637843}, \color{blue}{x}\right)\right) \]
        9. Simplified45.4%

          \[\leadsto \frac{1}{\color{blue}{\frac{1.0471975511965979}{x}}} \]
        10. Step-by-step derivation
          1. clear-numN/A

            \[\leadsto \frac{1}{\frac{1}{\color{blue}{\frac{x}{\frac{250000000000000}{238732414637843}}}}} \]
          2. associate-/r/N/A

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

            \[\leadsto \frac{\frac{1}{\frac{1}{x}}}{\color{blue}{\frac{250000000000000}{238732414637843}}} \]
          4. inv-powN/A

            \[\leadsto \frac{{\left(\frac{1}{x}\right)}^{-1}}{\frac{250000000000000}{238732414637843}} \]
          5. sqr-powN/A

            \[\leadsto \frac{{\left(\frac{1}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{1}{x}\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
          6. pow-prod-downN/A

            \[\leadsto \frac{{\left(\frac{1}{x} \cdot \frac{1}{x}\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
          7. sqr-negN/A

            \[\leadsto \frac{{\left(\left(\mathsf{neg}\left(\frac{1}{x}\right)\right) \cdot \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
          8. mul-1-negN/A

            \[\leadsto \frac{{\left(\left(-1 \cdot \frac{1}{x}\right) \cdot \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
          9. div-invN/A

            \[\leadsto \frac{{\left(\frac{-1}{x} \cdot \left(\mathsf{neg}\left(\frac{1}{x}\right)\right)\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
          10. mul-1-negN/A

            \[\leadsto \frac{{\left(\frac{-1}{x} \cdot \left(-1 \cdot \frac{1}{x}\right)\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
          11. div-invN/A

            \[\leadsto \frac{{\left(\frac{-1}{x} \cdot \frac{-1}{x}\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
          12. pow-prod-downN/A

            \[\leadsto \frac{{\left(\frac{-1}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{-1}{x}\right)}^{\left(\frac{-1}{2}\right)}}{\frac{250000000000000}{238732414637843}} \]
          13. sqr-powN/A

            \[\leadsto \frac{{\left(\frac{-1}{x}\right)}^{-1}}{\frac{250000000000000}{238732414637843}} \]
          14. inv-powN/A

            \[\leadsto \frac{\frac{1}{\frac{-1}{x}}}{\frac{250000000000000}{238732414637843}} \]
          15. frac-2negN/A

            \[\leadsto \frac{\frac{1}{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(x\right)}}}{\frac{250000000000000}{238732414637843}} \]
          16. metadata-evalN/A

            \[\leadsto \frac{\frac{1}{\frac{1}{\mathsf{neg}\left(x\right)}}}{\frac{250000000000000}{238732414637843}} \]
          17. remove-double-divN/A

            \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\frac{250000000000000}{238732414637843}} \]
          18. distribute-neg-fracN/A

            \[\leadsto \mathsf{neg}\left(\frac{x}{\frac{250000000000000}{238732414637843}}\right) \]
          19. div-invN/A

            \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{250000000000000}{238732414637843}}\right) \]
          20. distribute-rgt-neg-inN/A

            \[\leadsto x \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{\frac{250000000000000}{238732414637843}}\right)\right)} \]
          21. metadata-evalN/A

            \[\leadsto x \cdot \left(\mathsf{neg}\left(\frac{238732414637843}{250000000000000}\right)\right) \]
          22. metadata-evalN/A

            \[\leadsto x \cdot \frac{-238732414637843}{250000000000000} \]
          23. *-lowering-*.f645.0%

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\frac{-238732414637843}{250000000000000}}\right) \]
        11. Applied egg-rr5.0%

          \[\leadsto \color{blue}{x \cdot -0.954929658551372} \]
        12. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2024139 
        (FPCore (x)
          :name "Rosa's Benchmark"
          :precision binary64
          (- (* 0.954929658551372 x) (* 0.12900613773279798 (* (* x x) x))))