Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B

Percentage Accurate: 99.9% → 99.9%
Time: 8.0s
Alternatives: 13
Speedup: 1.2×

Specification

?
\[\begin{array}{l} \\ x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t):
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t)
	return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0))
end
function tmp = code(x, y, z, t)
	tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\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 13 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.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t):
	return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t)
	return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0))
end
function tmp = code(x, y, z, t)
	tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}

Alternative 1: 99.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma x (fma 2.0 (+ y z) t) (* y 5.0)))
double code(double x, double y, double z, double t) {
	return fma(x, fma(2.0, (y + z), t), (y * 5.0));
}
function code(x, y, z, t)
	return fma(x, fma(2.0, Float64(y + z), t), Float64(y * 5.0))
end
code[x_, y_, z_, t_] := N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0

    \[\leadsto \color{blue}{5 \cdot y + x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
  4. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right) + 5 \cdot y} \]
    2. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, t + \left(2 \cdot y + 2 \cdot z\right), 5 \cdot y\right)} \]
    3. +-commutativeN/A

      \[\leadsto \mathsf{fma}\left(x, \color{blue}{\left(2 \cdot y + 2 \cdot z\right) + t}, 5 \cdot y\right) \]
    4. distribute-lft-outN/A

      \[\leadsto \mathsf{fma}\left(x, \color{blue}{2 \cdot \left(y + z\right)} + t, 5 \cdot y\right) \]
    5. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(2, y + z, t\right)}, 5 \cdot y\right) \]
    6. lower-+.f64N/A

      \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(2, \color{blue}{y + z}, t\right), 5 \cdot y\right) \]
    7. lower-*.f6499.9

      \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), \color{blue}{5 \cdot y}\right) \]
  5. Simplified99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), 5 \cdot y\right)} \]
  6. Final simplification99.9%

    \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), y \cdot 5\right) \]
  7. Add Preprocessing

Alternative 2: 88.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -5.5 \cdot 10^{-25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-213}:\\ \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\ \mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(5, y, x \cdot \left(2 \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
   (if (<= x -5.5e-25)
     t_1
     (if (<= x -2.1e-213)
       (fma y 5.0 (* x t))
       (if (<= x 4.45e-7) (fma 5.0 y (* x (* 2.0 z))) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * fma(2.0, (y + z), t);
	double tmp;
	if (x <= -5.5e-25) {
		tmp = t_1;
	} else if (x <= -2.1e-213) {
		tmp = fma(y, 5.0, (x * t));
	} else if (x <= 4.45e-7) {
		tmp = fma(5.0, y, (x * (2.0 * z)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
	tmp = 0.0
	if (x <= -5.5e-25)
		tmp = t_1;
	elseif (x <= -2.1e-213)
		tmp = fma(y, 5.0, Float64(x * t));
	elseif (x <= 4.45e-7)
		tmp = fma(5.0, y, Float64(x * Float64(2.0 * z)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e-25], t$95$1, If[LessEqual[x, -2.1e-213], N[(y * 5.0 + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.45e-7], N[(5.0 * y + N[(x * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -2.1 \cdot 10^{-213}:\\
\;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\

\mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(5, y, x \cdot \left(2 \cdot z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.50000000000000004e-25 or 4.45e-7 < x

    1. Initial program 99.9%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
      3. distribute-lft-outN/A

        \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
      4. lower-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, y + z, t\right)} \]
      5. lower-+.f6496.6

        \[\leadsto x \cdot \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \]
    5. Simplified96.6%

      \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]

    if -5.50000000000000004e-25 < x < -2.0999999999999998e-213

    1. Initial program 99.9%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{5 \cdot y + x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right) + 5 \cdot y} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, t + \left(2 \cdot y + 2 \cdot z\right), 5 \cdot y\right)} \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\left(2 \cdot y + 2 \cdot z\right) + t}, 5 \cdot y\right) \]
      4. distribute-lft-outN/A

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{2 \cdot \left(y + z\right)} + t, 5 \cdot y\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(2, y + z, t\right)}, 5 \cdot y\right) \]
      6. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(2, \color{blue}{y + z}, t\right), 5 \cdot y\right) \]
      7. lower-*.f6499.9

        \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), \color{blue}{5 \cdot y}\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), 5 \cdot y\right)} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{5 \cdot y + x \cdot \left(t + 2 \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto 5 \cdot y + x \cdot \color{blue}{\left(2 \cdot y + t\right)} \]
      2. distribute-lft-inN/A

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

        \[\leadsto 5 \cdot y + \left(x \cdot \color{blue}{\left(y \cdot 2\right)} + x \cdot t\right) \]
      4. associate-*r*N/A

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

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

        \[\leadsto 5 \cdot y + \left(\color{blue}{2 \cdot \left(x \cdot y\right)} + t \cdot x\right) \]
      7. associate-*r*N/A

        \[\leadsto 5 \cdot y + \left(\color{blue}{\left(2 \cdot x\right) \cdot y} + t \cdot x\right) \]
      8. associate-+r+N/A

        \[\leadsto \color{blue}{\left(5 \cdot y + \left(2 \cdot x\right) \cdot y\right) + t \cdot x} \]
      9. distribute-rgt-inN/A

        \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} + t \cdot x \]
      10. +-commutativeN/A

        \[\leadsto y \cdot \color{blue}{\left(2 \cdot x + 5\right)} + t \cdot x \]
      11. metadata-evalN/A

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) + t \cdot x \]
      13. metadata-evalN/A

        \[\leadsto y \cdot \left(\left(\mathsf{neg}\left(-2 \cdot x\right)\right) + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + t \cdot x \]
      14. distribute-neg-inN/A

        \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(-2 \cdot x + -5\right)\right)\right)} + t \cdot x \]
      15. metadata-evalN/A

        \[\leadsto y \cdot \left(\mathsf{neg}\left(\left(-2 \cdot x + \color{blue}{\left(\mathsf{neg}\left(5\right)\right)}\right)\right)\right) + t \cdot x \]
      16. sub-negN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right), t \cdot x\right)} \]
    8. Simplified85.2%

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

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{5}, x \cdot t\right) \]
    10. Step-by-step derivation
      1. Simplified85.2%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{5}, x \cdot t\right) \]

      if -2.0999999999999998e-213 < x < 4.45e-7

      1. Initial program 99.9%

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

          \[\leadsto x \cdot \left(\left(\left(\color{blue}{\left(y + z\right)} + z\right) + y\right) + t\right) + y \cdot 5 \]
        2. lift-+.f64N/A

          \[\leadsto x \cdot \left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t\right) + y \cdot 5 \]
        3. lift-+.f64N/A

          \[\leadsto x \cdot \left(\color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right)} + t\right) + y \cdot 5 \]
        4. lift-+.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        5. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        6. lift-*.f64N/A

          \[\leadsto x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + \color{blue}{y \cdot 5} \]
        7. +-commutativeN/A

          \[\leadsto \color{blue}{y \cdot 5 + x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} \]
        8. lift-*.f64N/A

          \[\leadsto y \cdot 5 + \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} \]
        9. lift-+.f64N/A

          \[\leadsto y \cdot 5 + x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} \]
        10. distribute-rgt-inN/A

          \[\leadsto y \cdot 5 + \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} \]
        11. associate-+r+N/A

          \[\leadsto \color{blue}{\left(y \cdot 5 + \left(\left(\left(y + z\right) + z\right) + y\right) \cdot x\right) + t \cdot x} \]
        12. lower-+.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot 5 + \left(\left(\left(y + z\right) + z\right) + y\right) \cdot x\right) + t \cdot x} \]
      4. Applied egg-rr99.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, x \cdot \left(z + z\right)\right) + x \cdot t} \]
      5. Taylor expanded in t around 0

        \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right) + 5 \cdot y} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{5 \cdot y + 2 \cdot \left(x \cdot z\right)} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(5, y, 2 \cdot \left(x \cdot z\right)\right)} \]
        3. associate-*r*N/A

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

          \[\leadsto \mathsf{fma}\left(5, y, \color{blue}{\left(x \cdot 2\right)} \cdot z\right) \]
        5. associate-*r*N/A

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

          \[\leadsto \mathsf{fma}\left(5, y, \color{blue}{x \cdot \left(2 \cdot z\right)}\right) \]
        7. lower-*.f6485.3

          \[\leadsto \mathsf{fma}\left(5, y, x \cdot \color{blue}{\left(2 \cdot z\right)}\right) \]
      7. Simplified85.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(5, y, x \cdot \left(2 \cdot z\right)\right)} \]
    11. Recombined 3 regimes into one program.
    12. Add Preprocessing

    Alternative 3: 47.8% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(y + y\right)\\ \mathbf{if}\;x \leq -2 \cdot 10^{+225}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.55 \cdot 10^{-33}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+93}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (+ y y))))
       (if (<= x -2e+225)
         t_1
         (if (<= x -2.55e-33)
           (* x t)
           (if (<= x 4.45e-7) (* y 5.0) (if (<= x 4.2e+93) (* x t) t_1))))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * (y + y);
    	double tmp;
    	if (x <= -2e+225) {
    		tmp = t_1;
    	} else if (x <= -2.55e-33) {
    		tmp = x * t;
    	} else if (x <= 4.45e-7) {
    		tmp = y * 5.0;
    	} else if (x <= 4.2e+93) {
    		tmp = x * t;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: t_1
        real(8) :: tmp
        t_1 = x * (y + y)
        if (x <= (-2d+225)) then
            tmp = t_1
        else if (x <= (-2.55d-33)) then
            tmp = x * t
        else if (x <= 4.45d-7) then
            tmp = y * 5.0d0
        else if (x <= 4.2d+93) then
            tmp = x * t
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double t_1 = x * (y + y);
    	double tmp;
    	if (x <= -2e+225) {
    		tmp = t_1;
    	} else if (x <= -2.55e-33) {
    		tmp = x * t;
    	} else if (x <= 4.45e-7) {
    		tmp = y * 5.0;
    	} else if (x <= 4.2e+93) {
    		tmp = x * t;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = x * (y + y)
    	tmp = 0
    	if x <= -2e+225:
    		tmp = t_1
    	elif x <= -2.55e-33:
    		tmp = x * t
    	elif x <= 4.45e-7:
    		tmp = y * 5.0
    	elif x <= 4.2e+93:
    		tmp = x * t
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(x * Float64(y + y))
    	tmp = 0.0
    	if (x <= -2e+225)
    		tmp = t_1;
    	elseif (x <= -2.55e-33)
    		tmp = Float64(x * t);
    	elseif (x <= 4.45e-7)
    		tmp = Float64(y * 5.0);
    	elseif (x <= 4.2e+93)
    		tmp = Float64(x * t);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = x * (y + y);
    	tmp = 0.0;
    	if (x <= -2e+225)
    		tmp = t_1;
    	elseif (x <= -2.55e-33)
    		tmp = x * t;
    	elseif (x <= 4.45e-7)
    		tmp = y * 5.0;
    	elseif (x <= 4.2e+93)
    		tmp = x * t;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+225], t$95$1, If[LessEqual[x, -2.55e-33], N[(x * t), $MachinePrecision], If[LessEqual[x, 4.45e-7], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 4.2e+93], N[(x * t), $MachinePrecision], t$95$1]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \left(y + y\right)\\
    \mathbf{if}\;x \leq -2 \cdot 10^{+225}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq -2.55 \cdot 10^{-33}:\\
    \;\;\;\;x \cdot t\\
    
    \mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\
    \;\;\;\;y \cdot 5\\
    
    \mathbf{elif}\;x \leq 4.2 \cdot 10^{+93}:\\
    \;\;\;\;x \cdot t\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -1.99999999999999986e225 or 4.1999999999999996e93 < x

      1. Initial program 100.0%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
        3. distribute-lft-outN/A

          \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
        4. lower-fma.f64N/A

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, y + z, t\right)} \]
        5. lower-+.f64100.0

          \[\leadsto x \cdot \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \]
      5. Simplified100.0%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]
      6. Taylor expanded in y around inf

        \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
      7. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

          \[\leadsto y \cdot \color{blue}{\left(\left(\mathsf{neg}\left(-2\right)\right) \cdot x\right)} \]
        7. metadata-evalN/A

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

          \[\leadsto y \cdot \color{blue}{\left(x \cdot 2\right)} \]
        9. lower-*.f6451.1

          \[\leadsto y \cdot \color{blue}{\left(x \cdot 2\right)} \]
      8. Simplified51.1%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot 2\right)} \]
      9. Taylor expanded in y around 0

        \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
      10. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

          \[\leadsto \color{blue}{x \cdot \left(2 \cdot y\right)} \]
        5. count-2N/A

          \[\leadsto x \cdot \color{blue}{\left(y + y\right)} \]
        6. lower-+.f6451.1

          \[\leadsto x \cdot \color{blue}{\left(y + y\right)} \]
      11. Simplified51.1%

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

      if -1.99999999999999986e225 < x < -2.55000000000000004e-33 or 4.45e-7 < x < 4.1999999999999996e93

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in t around inf

        \[\leadsto \color{blue}{t \cdot x} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{x \cdot t} \]
        2. lower-*.f6443.2

          \[\leadsto \color{blue}{x \cdot t} \]
      5. Simplified43.2%

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

      if -2.55000000000000004e-33 < x < 4.45e-7

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{5 \cdot y} \]
      4. Step-by-step derivation
        1. lower-*.f6457.6

          \[\leadsto \color{blue}{5 \cdot y} \]
      5. Simplified57.6%

        \[\leadsto \color{blue}{5 \cdot y} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification52.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{+225}:\\ \;\;\;\;x \cdot \left(y + y\right)\\ \mathbf{elif}\;x \leq -2.55 \cdot 10^{-33}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+93}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y + y\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 79.3% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{if}\;y \leq -5.5 \cdot 10^{+53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 55:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* y (fma x 2.0 5.0))))
       (if (<= y -5.5e+53)
         t_1
         (if (<= y 55.0)
           (* x (fma 2.0 z t))
           (if (<= y 1.4e+118) (fma x t (* y 5.0)) t_1)))))
    double code(double x, double y, double z, double t) {
    	double t_1 = y * fma(x, 2.0, 5.0);
    	double tmp;
    	if (y <= -5.5e+53) {
    		tmp = t_1;
    	} else if (y <= 55.0) {
    		tmp = x * fma(2.0, z, t);
    	} else if (y <= 1.4e+118) {
    		tmp = fma(x, t, (y * 5.0));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(y * fma(x, 2.0, 5.0))
    	tmp = 0.0
    	if (y <= -5.5e+53)
    		tmp = t_1;
    	elseif (y <= 55.0)
    		tmp = Float64(x * fma(2.0, z, t));
    	elseif (y <= 1.4e+118)
    		tmp = fma(x, t, Float64(y * 5.0));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+53], t$95$1, If[LessEqual[y, 55.0], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+118], N[(x * t + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
    \mathbf{if}\;y \leq -5.5 \cdot 10^{+53}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y \leq 55:\\
    \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
    
    \mathbf{elif}\;y \leq 1.4 \cdot 10^{+118}:\\
    \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -5.49999999999999975e53 or 1.39999999999999993e118 < y

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in y around inf

        \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto y \cdot \color{blue}{\left(2 \cdot x + 5\right)} \]
        2. metadata-evalN/A

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

          \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
        4. neg-sub0N/A

          \[\leadsto y \cdot \left(\color{blue}{\left(0 - -2 \cdot x\right)} + 5\right) \]
        5. associate--r-N/A

          \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
        6. neg-sub0N/A

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

          \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
        8. neg-sub0N/A

          \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
        9. associate--r-N/A

          \[\leadsto y \cdot \color{blue}{\left(\left(0 - -2 \cdot x\right) + 5\right)} \]
        10. neg-sub0N/A

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

          \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right) \cdot x} + 5\right) \]
        12. metadata-evalN/A

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

          \[\leadsto y \cdot \left(\color{blue}{x \cdot 2} + 5\right) \]
        14. lower-fma.f6481.3

          \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(x, 2, 5\right)} \]
      5. Simplified81.3%

        \[\leadsto \color{blue}{y \cdot \mathsf{fma}\left(x, 2, 5\right)} \]

      if -5.49999999999999975e53 < y < 55

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

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

          \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
        3. lower-fma.f6482.7

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
      5. Simplified82.7%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, z, t\right)} \]

      if 55 < y < 1.39999999999999993e118

      1. Initial program 99.9%

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

          \[\leadsto x \cdot \left(\left(\left(\color{blue}{\left(y + z\right)} + z\right) + y\right) + t\right) + y \cdot 5 \]
        2. lift-+.f64N/A

          \[\leadsto x \cdot \left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t\right) + y \cdot 5 \]
        3. lift-+.f64N/A

          \[\leadsto x \cdot \left(\color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right)} + t\right) + y \cdot 5 \]
        4. lift-+.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        5. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        6. lift-*.f64N/A

          \[\leadsto x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + \color{blue}{y \cdot 5} \]
        7. +-commutativeN/A

          \[\leadsto \color{blue}{y \cdot 5 + x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} \]
        8. lift-*.f64N/A

          \[\leadsto y \cdot 5 + \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} \]
        9. lift-+.f64N/A

          \[\leadsto y \cdot 5 + x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} \]
        10. distribute-rgt-inN/A

          \[\leadsto y \cdot 5 + \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} \]
        11. associate-+r+N/A

          \[\leadsto \color{blue}{\left(y \cdot 5 + \left(\left(\left(y + z\right) + z\right) + y\right) \cdot x\right) + t \cdot x} \]
        12. lower-+.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot 5 + \left(\left(\left(y + z\right) + z\right) + y\right) \cdot x\right) + t \cdot x} \]
      4. Applied egg-rr96.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, x \cdot \left(z + z\right)\right) + x \cdot t} \]
      5. Taylor expanded in z around 0

        \[\leadsto \color{blue}{5 \cdot y + t \cdot x} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{t \cdot x + 5 \cdot y} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{x \cdot t} + 5 \cdot y \]
        3. metadata-evalN/A

          \[\leadsto x \cdot t + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)} \cdot y \]
        4. distribute-lft-neg-inN/A

          \[\leadsto x \cdot t + \color{blue}{\left(\mathsf{neg}\left(-5 \cdot y\right)\right)} \]
        5. *-rgt-identityN/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(-5 \cdot \color{blue}{\left(y \cdot 1\right)}\right)\right) \]
        6. *-inversesN/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(-5 \cdot \left(y \cdot \color{blue}{\frac{z}{z}}\right)\right)\right) \]
        7. associate-/l*N/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(-5 \cdot \color{blue}{\frac{y \cdot z}{z}}\right)\right) \]
        8. associate-*l/N/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(-5 \cdot \color{blue}{\left(\frac{y}{z} \cdot z\right)}\right)\right) \]
        9. associate-*l*N/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(\color{blue}{\left(-5 \cdot \frac{y}{z}\right) \cdot z}\right)\right) \]
        10. associate-*r/N/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(\color{blue}{\frac{-5 \cdot y}{z}} \cdot z\right)\right) \]
        11. associate-*l/N/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(\color{blue}{\frac{\left(-5 \cdot y\right) \cdot z}{z}}\right)\right) \]
        12. associate-/l*N/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(\color{blue}{\left(-5 \cdot y\right) \cdot \frac{z}{z}}\right)\right) \]
        13. *-inversesN/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(\left(-5 \cdot y\right) \cdot \color{blue}{1}\right)\right) \]
        14. *-inversesN/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(\left(-5 \cdot y\right) \cdot \color{blue}{\frac{x}{x}}\right)\right) \]
        15. associate-/l*N/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(\color{blue}{\frac{\left(-5 \cdot y\right) \cdot x}{x}}\right)\right) \]
        16. associate-*l/N/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(\color{blue}{\frac{-5 \cdot y}{x} \cdot x}\right)\right) \]
        17. associate-*r/N/A

          \[\leadsto x \cdot t + \left(\mathsf{neg}\left(\color{blue}{\left(-5 \cdot \frac{y}{x}\right)} \cdot x\right)\right) \]
        18. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, t, \mathsf{neg}\left(\left(-5 \cdot \frac{y}{x}\right) \cdot x\right)\right)} \]
        19. associate-*r/N/A

          \[\leadsto \mathsf{fma}\left(x, t, \mathsf{neg}\left(\color{blue}{\frac{-5 \cdot y}{x}} \cdot x\right)\right) \]
        20. associate-*l/N/A

          \[\leadsto \mathsf{fma}\left(x, t, \mathsf{neg}\left(\color{blue}{\frac{\left(-5 \cdot y\right) \cdot x}{x}}\right)\right) \]
        21. associate-/l*N/A

          \[\leadsto \mathsf{fma}\left(x, t, \mathsf{neg}\left(\color{blue}{\left(-5 \cdot y\right) \cdot \frac{x}{x}}\right)\right) \]
        22. *-inversesN/A

          \[\leadsto \mathsf{fma}\left(x, t, \mathsf{neg}\left(\left(-5 \cdot y\right) \cdot \color{blue}{1}\right)\right) \]
        23. *-inversesN/A

          \[\leadsto \mathsf{fma}\left(x, t, \mathsf{neg}\left(\left(-5 \cdot y\right) \cdot \color{blue}{\frac{z}{z}}\right)\right) \]
        24. associate-/l*N/A

          \[\leadsto \mathsf{fma}\left(x, t, \mathsf{neg}\left(\color{blue}{\frac{\left(-5 \cdot y\right) \cdot z}{z}}\right)\right) \]
      7. Simplified80.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, t, 5 \cdot y\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification81.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+53}:\\ \;\;\;\;y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{elif}\;y \leq 55:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 66.3% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{if}\;x \leq -1.05 \cdot 10^{-37}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-132}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-10}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(y, 2, t\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (fma 2.0 z t))))
       (if (<= x -1.05e-37)
         t_1
         (if (<= x 7e-132) (* y 5.0) (if (<= x 8e-10) t_1 (* x (fma y 2.0 t)))))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * fma(2.0, z, t);
    	double tmp;
    	if (x <= -1.05e-37) {
    		tmp = t_1;
    	} else if (x <= 7e-132) {
    		tmp = y * 5.0;
    	} else if (x <= 8e-10) {
    		tmp = t_1;
    	} else {
    		tmp = x * fma(y, 2.0, t);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(x * fma(2.0, z, t))
    	tmp = 0.0
    	if (x <= -1.05e-37)
    		tmp = t_1;
    	elseif (x <= 7e-132)
    		tmp = Float64(y * 5.0);
    	elseif (x <= 8e-10)
    		tmp = t_1;
    	else
    		tmp = Float64(x * fma(y, 2.0, t));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e-37], t$95$1, If[LessEqual[x, 7e-132], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 8e-10], t$95$1, N[(x * N[(y * 2.0 + t), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \mathsf{fma}\left(2, z, t\right)\\
    \mathbf{if}\;x \leq -1.05 \cdot 10^{-37}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq 7 \cdot 10^{-132}:\\
    \;\;\;\;y \cdot 5\\
    
    \mathbf{elif}\;x \leq 8 \cdot 10^{-10}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot \mathsf{fma}\left(y, 2, t\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -1.05e-37 or 6.9999999999999999e-132 < x < 8.00000000000000029e-10

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

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

          \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
        3. lower-fma.f6467.1

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
      5. Simplified67.1%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, z, t\right)} \]

      if -1.05e-37 < x < 6.9999999999999999e-132

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{5 \cdot y} \]
      4. Step-by-step derivation
        1. lower-*.f6464.2

          \[\leadsto \color{blue}{5 \cdot y} \]
      5. Simplified64.2%

        \[\leadsto \color{blue}{5 \cdot y} \]

      if 8.00000000000000029e-10 < x

      1. Initial program 100.0%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
        3. distribute-lft-outN/A

          \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
        4. lower-fma.f64N/A

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, y + z, t\right)} \]
        5. lower-+.f6497.3

          \[\leadsto x \cdot \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \]
      5. Simplified97.3%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]
      6. Taylor expanded in z around 0

        \[\leadsto x \cdot \color{blue}{\left(t + 2 \cdot y\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

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

          \[\leadsto x \cdot \left(\color{blue}{y \cdot 2} + t\right) \]
        3. lower-fma.f6478.9

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(y, 2, t\right)} \]
      8. Simplified78.9%

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(y, 2, t\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification68.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-132}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-10}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(y, 2, t\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 64.4% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{+250}:\\ \;\;\;\;x \cdot \left(y + y\right)\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+73}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq 10^{+53}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= y -3.3e+250)
       (* x (+ y y))
       (if (<= y -5.5e+73)
         (* y 5.0)
         (if (<= y 1e+53) (* x (fma 2.0 z t)) (* y 5.0)))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= -3.3e+250) {
    		tmp = x * (y + y);
    	} else if (y <= -5.5e+73) {
    		tmp = y * 5.0;
    	} else if (y <= 1e+53) {
    		tmp = x * fma(2.0, z, t);
    	} else {
    		tmp = y * 5.0;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (y <= -3.3e+250)
    		tmp = Float64(x * Float64(y + y));
    	elseif (y <= -5.5e+73)
    		tmp = Float64(y * 5.0);
    	elseif (y <= 1e+53)
    		tmp = Float64(x * fma(2.0, z, t));
    	else
    		tmp = Float64(y * 5.0);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[y, -3.3e+250], N[(x * N[(y + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.5e+73], N[(y * 5.0), $MachinePrecision], If[LessEqual[y, 1e+53], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq -3.3 \cdot 10^{+250}:\\
    \;\;\;\;x \cdot \left(y + y\right)\\
    
    \mathbf{elif}\;y \leq -5.5 \cdot 10^{+73}:\\
    \;\;\;\;y \cdot 5\\
    
    \mathbf{elif}\;y \leq 10^{+53}:\\
    \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;y \cdot 5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -3.30000000000000006e250

      1. Initial program 100.0%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
        3. distribute-lft-outN/A

          \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
        4. lower-fma.f64N/A

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, y + z, t\right)} \]
        5. lower-+.f6464.8

          \[\leadsto x \cdot \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \]
      5. Simplified64.8%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]
      6. Taylor expanded in y around inf

        \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
      7. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

          \[\leadsto y \cdot \color{blue}{\left(\left(\mathsf{neg}\left(-2\right)\right) \cdot x\right)} \]
        7. metadata-evalN/A

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

          \[\leadsto y \cdot \color{blue}{\left(x \cdot 2\right)} \]
        9. lower-*.f6463.8

          \[\leadsto y \cdot \color{blue}{\left(x \cdot 2\right)} \]
      8. Simplified63.8%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot 2\right)} \]
      9. Taylor expanded in y around 0

        \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
      10. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

          \[\leadsto \color{blue}{x \cdot \left(2 \cdot y\right)} \]
        5. count-2N/A

          \[\leadsto x \cdot \color{blue}{\left(y + y\right)} \]
        6. lower-+.f6463.8

          \[\leadsto x \cdot \color{blue}{\left(y + y\right)} \]
      11. Simplified63.8%

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

      if -3.30000000000000006e250 < y < -5.5000000000000003e73 or 9.9999999999999999e52 < y

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{5 \cdot y} \]
      4. Step-by-step derivation
        1. lower-*.f6450.3

          \[\leadsto \color{blue}{5 \cdot y} \]
      5. Simplified50.3%

        \[\leadsto \color{blue}{5 \cdot y} \]

      if -5.5000000000000003e73 < y < 9.9999999999999999e52

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

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

          \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
        3. lower-fma.f6478.8

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
      5. Simplified78.8%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, z, t\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification66.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{+250}:\\ \;\;\;\;x \cdot \left(y + y\right)\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+73}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq 10^{+53}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 99.3% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -48000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.5:\\ \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
       (if (<= x -48000.0)
         t_1
         (if (<= x 2.5) (fma y 5.0 (* x (+ t (+ z z)))) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * fma(2.0, (y + z), t);
    	double tmp;
    	if (x <= -48000.0) {
    		tmp = t_1;
    	} else if (x <= 2.5) {
    		tmp = fma(y, 5.0, (x * (t + (z + z))));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
    	tmp = 0.0
    	if (x <= -48000.0)
    		tmp = t_1;
    	elseif (x <= 2.5)
    		tmp = fma(y, 5.0, Float64(x * Float64(t + Float64(z + z))));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -48000.0], t$95$1, If[LessEqual[x, 2.5], N[(y * 5.0 + N[(x * N[(t + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
    \mathbf{if}\;x \leq -48000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq 2.5:\\
    \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -48000 or 2.5 < x

      1. Initial program 100.0%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
        3. distribute-lft-outN/A

          \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
        4. lower-fma.f64N/A

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, y + z, t\right)} \]
        5. lower-+.f6498.9

          \[\leadsto x \cdot \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \]
      5. Simplified98.9%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]

      if -48000 < x < 2.5

      1. Initial program 99.9%

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

          \[\leadsto x \cdot \left(\left(\left(\color{blue}{\left(y + z\right)} + z\right) + y\right) + t\right) + y \cdot 5 \]
        2. lift-+.f64N/A

          \[\leadsto x \cdot \left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t\right) + y \cdot 5 \]
        3. lift-+.f64N/A

          \[\leadsto x \cdot \left(\color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right)} + t\right) + y \cdot 5 \]
        4. lift-+.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        5. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        6. lift-*.f64N/A

          \[\leadsto x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + \color{blue}{y \cdot 5} \]
        7. +-commutativeN/A

          \[\leadsto \color{blue}{y \cdot 5 + x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} \]
        8. lift-*.f64N/A

          \[\leadsto \color{blue}{y \cdot 5} + x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \]
        9. lower-fma.f64100.0

          \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)} \]
      4. Applied egg-rr98.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, x \cdot \left(\left(z + z\right) + t\right)\right)} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification98.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -48000:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{elif}\;x \leq 2.5:\\ \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 86.1% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.7 \cdot 10^{+109}:\\ \;\;\;\;\mathsf{fma}\left(5, y, x \cdot \left(2 \cdot z\right)\right)\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= z -5.7e+109)
       (fma 5.0 y (* x (* 2.0 z)))
       (if (<= z 2.9e+112)
         (fma x (fma y 2.0 t) (* y 5.0))
         (* x (fma 2.0 (+ y z) t)))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -5.7e+109) {
    		tmp = fma(5.0, y, (x * (2.0 * z)));
    	} else if (z <= 2.9e+112) {
    		tmp = fma(x, fma(y, 2.0, t), (y * 5.0));
    	} else {
    		tmp = x * fma(2.0, (y + z), t);
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (z <= -5.7e+109)
    		tmp = fma(5.0, y, Float64(x * Float64(2.0 * z)));
    	elseif (z <= 2.9e+112)
    		tmp = fma(x, fma(y, 2.0, t), Float64(y * 5.0));
    	else
    		tmp = Float64(x * fma(2.0, Float64(y + z), t));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[z, -5.7e+109], N[(5.0 * y + N[(x * N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+112], N[(x * N[(y * 2.0 + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -5.7 \cdot 10^{+109}:\\
    \;\;\;\;\mathsf{fma}\left(5, y, x \cdot \left(2 \cdot z\right)\right)\\
    
    \mathbf{elif}\;z \leq 2.9 \cdot 10^{+112}:\\
    \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), y \cdot 5\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -5.7000000000000002e109

      1. Initial program 100.0%

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

          \[\leadsto x \cdot \left(\left(\left(\color{blue}{\left(y + z\right)} + z\right) + y\right) + t\right) + y \cdot 5 \]
        2. lift-+.f64N/A

          \[\leadsto x \cdot \left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t\right) + y \cdot 5 \]
        3. lift-+.f64N/A

          \[\leadsto x \cdot \left(\color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right)} + t\right) + y \cdot 5 \]
        4. lift-+.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        5. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        6. lift-*.f64N/A

          \[\leadsto x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + \color{blue}{y \cdot 5} \]
        7. +-commutativeN/A

          \[\leadsto \color{blue}{y \cdot 5 + x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} \]
        8. lift-*.f64N/A

          \[\leadsto y \cdot 5 + \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} \]
        9. lift-+.f64N/A

          \[\leadsto y \cdot 5 + x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} \]
        10. distribute-rgt-inN/A

          \[\leadsto y \cdot 5 + \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} \]
        11. associate-+r+N/A

          \[\leadsto \color{blue}{\left(y \cdot 5 + \left(\left(\left(y + z\right) + z\right) + y\right) \cdot x\right) + t \cdot x} \]
        12. lower-+.f64N/A

          \[\leadsto \color{blue}{\left(y \cdot 5 + \left(\left(\left(y + z\right) + z\right) + y\right) \cdot x\right) + t \cdot x} \]
      4. Applied egg-rr93.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, x \cdot \left(z + z\right)\right) + x \cdot t} \]
      5. Taylor expanded in t around 0

        \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right) + 5 \cdot y} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{5 \cdot y + 2 \cdot \left(x \cdot z\right)} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(5, y, 2 \cdot \left(x \cdot z\right)\right)} \]
        3. associate-*r*N/A

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

          \[\leadsto \mathsf{fma}\left(5, y, \color{blue}{\left(x \cdot 2\right)} \cdot z\right) \]
        5. associate-*r*N/A

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

          \[\leadsto \mathsf{fma}\left(5, y, \color{blue}{x \cdot \left(2 \cdot z\right)}\right) \]
        7. lower-*.f6487.4

          \[\leadsto \mathsf{fma}\left(5, y, x \cdot \color{blue}{\left(2 \cdot z\right)}\right) \]
      7. Simplified87.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(5, y, x \cdot \left(2 \cdot z\right)\right)} \]

      if -5.7000000000000002e109 < z < 2.9000000000000002e112

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in z around 0

        \[\leadsto \color{blue}{5 \cdot y + x \cdot \left(t + 2 \cdot y\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot y\right) + 5 \cdot y} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, t + 2 \cdot y, 5 \cdot y\right)} \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(x, \color{blue}{2 \cdot y + t}, 5 \cdot y\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(x, \color{blue}{y \cdot 2} + t, 5 \cdot y\right) \]
        5. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(y, 2, t\right)}, 5 \cdot y\right) \]
        6. lower-*.f6491.6

          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), \color{blue}{5 \cdot y}\right) \]
      5. Simplified91.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), 5 \cdot y\right)} \]

      if 2.9000000000000002e112 < z

      1. Initial program 100.0%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
        3. distribute-lft-outN/A

          \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
        4. lower-fma.f64N/A

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, y + z, t\right)} \]
        5. lower-+.f6483.9

          \[\leadsto x \cdot \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \]
      5. Simplified83.9%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification89.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.7 \cdot 10^{+109}:\\ \;\;\;\;\mathsf{fma}\left(5, y, x \cdot \left(2 \cdot z\right)\right)\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 47.8% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-25}:\\ \;\;\;\;z \cdot \left(x + x\right)\\ \mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+93}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y + y\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= x -5.5e-25)
       (* z (+ x x))
       (if (<= x 4.45e-7) (* y 5.0) (if (<= x 4.2e+93) (* x t) (* x (+ y y))))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (x <= -5.5e-25) {
    		tmp = z * (x + x);
    	} else if (x <= 4.45e-7) {
    		tmp = y * 5.0;
    	} else if (x <= 4.2e+93) {
    		tmp = x * t;
    	} else {
    		tmp = x * (y + y);
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: tmp
        if (x <= (-5.5d-25)) then
            tmp = z * (x + x)
        else if (x <= 4.45d-7) then
            tmp = y * 5.0d0
        else if (x <= 4.2d+93) then
            tmp = x * t
        else
            tmp = x * (y + y)
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (x <= -5.5e-25) {
    		tmp = z * (x + x);
    	} else if (x <= 4.45e-7) {
    		tmp = y * 5.0;
    	} else if (x <= 4.2e+93) {
    		tmp = x * t;
    	} else {
    		tmp = x * (y + y);
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	tmp = 0
    	if x <= -5.5e-25:
    		tmp = z * (x + x)
    	elif x <= 4.45e-7:
    		tmp = y * 5.0
    	elif x <= 4.2e+93:
    		tmp = x * t
    	else:
    		tmp = x * (y + y)
    	return tmp
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (x <= -5.5e-25)
    		tmp = Float64(z * Float64(x + x));
    	elseif (x <= 4.45e-7)
    		tmp = Float64(y * 5.0);
    	elseif (x <= 4.2e+93)
    		tmp = Float64(x * t);
    	else
    		tmp = Float64(x * Float64(y + y));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (x <= -5.5e-25)
    		tmp = z * (x + x);
    	elseif (x <= 4.45e-7)
    		tmp = y * 5.0;
    	elseif (x <= 4.2e+93)
    		tmp = x * t;
    	else
    		tmp = x * (y + y);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[x, -5.5e-25], N[(z * N[(x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.45e-7], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 4.2e+93], N[(x * t), $MachinePrecision], N[(x * N[(y + y), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -5.5 \cdot 10^{-25}:\\
    \;\;\;\;z \cdot \left(x + x\right)\\
    
    \mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\
    \;\;\;\;y \cdot 5\\
    
    \mathbf{elif}\;x \leq 4.2 \cdot 10^{+93}:\\
    \;\;\;\;x \cdot t\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot \left(y + y\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if x < -5.50000000000000004e-25

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
        3. distribute-lft-outN/A

          \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
        4. lower-fma.f64N/A

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, y + z, t\right)} \]
        5. lower-+.f6494.9

          \[\leadsto x \cdot \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \]
      5. Simplified94.9%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]
      6. Taylor expanded in t around 0

        \[\leadsto x \cdot \color{blue}{\left(2 \cdot \left(y + z\right)\right)} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(2 \cdot \left(y + z\right)\right)} \]
        2. lower-+.f6468.6

          \[\leadsto x \cdot \left(2 \cdot \color{blue}{\left(y + z\right)}\right) \]
      8. Simplified68.6%

        \[\leadsto x \cdot \color{blue}{\left(2 \cdot \left(y + z\right)\right)} \]
      9. Step-by-step derivation
        1. distribute-lft-inN/A

          \[\leadsto x \cdot \color{blue}{\left(2 \cdot y + 2 \cdot z\right)} \]
        2. count-2N/A

          \[\leadsto x \cdot \left(2 \cdot y + \color{blue}{\left(z + z\right)}\right) \]
        3. associate-+r+N/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + z\right) + z\right)} \]
        4. lower-+.f64N/A

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

          \[\leadsto x \cdot \left(\left(\color{blue}{y \cdot 2} + z\right) + z\right) \]
        6. lower-fma.f6468.6

          \[\leadsto x \cdot \left(\color{blue}{\mathsf{fma}\left(y, 2, z\right)} + z\right) \]
      10. Applied egg-rr68.6%

        \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(y, 2, z\right) + z\right)} \]
      11. Taylor expanded in y around 0

        \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
      12. Step-by-step derivation
        1. associate-*r*N/A

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

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

          \[\leadsto \color{blue}{\left(x + x\right)} \cdot z \]
        4. lower-+.f6441.6

          \[\leadsto \color{blue}{\left(x + x\right)} \cdot z \]
      13. Simplified41.6%

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

      if -5.50000000000000004e-25 < x < 4.45e-7

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{5 \cdot y} \]
      4. Step-by-step derivation
        1. lower-*.f6457.5

          \[\leadsto \color{blue}{5 \cdot y} \]
      5. Simplified57.5%

        \[\leadsto \color{blue}{5 \cdot y} \]

      if 4.45e-7 < x < 4.1999999999999996e93

      1. Initial program 100.0%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in t around inf

        \[\leadsto \color{blue}{t \cdot x} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{x \cdot t} \]
        2. lower-*.f6469.9

          \[\leadsto \color{blue}{x \cdot t} \]
      5. Simplified69.9%

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

      if 4.1999999999999996e93 < x

      1. Initial program 100.0%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
        3. distribute-lft-outN/A

          \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
        4. lower-fma.f64N/A

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, y + z, t\right)} \]
        5. lower-+.f64100.0

          \[\leadsto x \cdot \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \]
      5. Simplified100.0%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]
      6. Taylor expanded in y around inf

        \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
      7. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

          \[\leadsto y \cdot \color{blue}{\left(\left(\mathsf{neg}\left(-2\right)\right) \cdot x\right)} \]
        7. metadata-evalN/A

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

          \[\leadsto y \cdot \color{blue}{\left(x \cdot 2\right)} \]
        9. lower-*.f6449.6

          \[\leadsto y \cdot \color{blue}{\left(x \cdot 2\right)} \]
      8. Simplified49.6%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot 2\right)} \]
      9. Taylor expanded in y around 0

        \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
      10. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

          \[\leadsto \color{blue}{x \cdot \left(2 \cdot y\right)} \]
        5. count-2N/A

          \[\leadsto x \cdot \color{blue}{\left(y + y\right)} \]
        6. lower-+.f6449.6

          \[\leadsto x \cdot \color{blue}{\left(y + y\right)} \]
      11. Simplified49.6%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{-25}:\\ \;\;\;\;z \cdot \left(x + x\right)\\ \mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+93}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y + y\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 87.8% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -5.5 \cdot 10^{-25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-131}:\\ \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
       (if (<= x -5.5e-25) t_1 (if (<= x 4.5e-131) (fma y 5.0 (* x t)) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * fma(2.0, (y + z), t);
    	double tmp;
    	if (x <= -5.5e-25) {
    		tmp = t_1;
    	} else if (x <= 4.5e-131) {
    		tmp = fma(y, 5.0, (x * t));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
    	tmp = 0.0
    	if (x <= -5.5e-25)
    		tmp = t_1;
    	elseif (x <= 4.5e-131)
    		tmp = fma(y, 5.0, Float64(x * t));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e-25], t$95$1, If[LessEqual[x, 4.5e-131], N[(y * 5.0 + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
    \mathbf{if}\;x \leq -5.5 \cdot 10^{-25}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq 4.5 \cdot 10^{-131}:\\
    \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -5.50000000000000004e-25 or 4.5000000000000002e-131 < x

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
        3. distribute-lft-outN/A

          \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
        4. lower-fma.f64N/A

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, y + z, t\right)} \]
        5. lower-+.f6491.3

          \[\leadsto x \cdot \mathsf{fma}\left(2, \color{blue}{y + z}, t\right) \]
      5. Simplified91.3%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]

      if -5.50000000000000004e-25 < x < 4.5000000000000002e-131

      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{5 \cdot y + x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right) + 5 \cdot y} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, t + \left(2 \cdot y + 2 \cdot z\right), 5 \cdot y\right)} \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(x, \color{blue}{\left(2 \cdot y + 2 \cdot z\right) + t}, 5 \cdot y\right) \]
        4. distribute-lft-outN/A

          \[\leadsto \mathsf{fma}\left(x, \color{blue}{2 \cdot \left(y + z\right)} + t, 5 \cdot y\right) \]
        5. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(2, y + z, t\right)}, 5 \cdot y\right) \]
        6. lower-+.f64N/A

          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(2, \color{blue}{y + z}, t\right), 5 \cdot y\right) \]
        7. lower-*.f6499.9

          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), \color{blue}{5 \cdot y}\right) \]
      5. Simplified99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), 5 \cdot y\right)} \]
      6. Taylor expanded in z around 0

        \[\leadsto \color{blue}{5 \cdot y + x \cdot \left(t + 2 \cdot y\right)} \]
      7. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto 5 \cdot y + x \cdot \color{blue}{\left(2 \cdot y + t\right)} \]
        2. distribute-lft-inN/A

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

          \[\leadsto 5 \cdot y + \left(x \cdot \color{blue}{\left(y \cdot 2\right)} + x \cdot t\right) \]
        4. associate-*r*N/A

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

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

          \[\leadsto 5 \cdot y + \left(\color{blue}{2 \cdot \left(x \cdot y\right)} + t \cdot x\right) \]
        7. associate-*r*N/A

          \[\leadsto 5 \cdot y + \left(\color{blue}{\left(2 \cdot x\right) \cdot y} + t \cdot x\right) \]
        8. associate-+r+N/A

          \[\leadsto \color{blue}{\left(5 \cdot y + \left(2 \cdot x\right) \cdot y\right) + t \cdot x} \]
        9. distribute-rgt-inN/A

          \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} + t \cdot x \]
        10. +-commutativeN/A

          \[\leadsto y \cdot \color{blue}{\left(2 \cdot x + 5\right)} + t \cdot x \]
        11. metadata-evalN/A

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

          \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) + t \cdot x \]
        13. metadata-evalN/A

          \[\leadsto y \cdot \left(\left(\mathsf{neg}\left(-2 \cdot x\right)\right) + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + t \cdot x \]
        14. distribute-neg-inN/A

          \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(-2 \cdot x + -5\right)\right)\right)} + t \cdot x \]
        15. metadata-evalN/A

          \[\leadsto y \cdot \left(\mathsf{neg}\left(\left(-2 \cdot x + \color{blue}{\left(\mathsf{neg}\left(5\right)\right)}\right)\right)\right) + t \cdot x \]
        16. sub-negN/A

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right), t \cdot x\right)} \]
      8. Simplified80.6%

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{5}, x \cdot t\right) \]
      10. Step-by-step derivation
        1. Simplified80.6%

          \[\leadsto \mathsf{fma}\left(y, \color{blue}{5}, x \cdot t\right) \]
      11. Recombined 2 regimes into one program.
      12. Add Preprocessing

      Alternative 11: 79.2% accurate, 1.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{if}\;y \leq -5.5 \cdot 10^{+53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+52}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* y (fma x 2.0 5.0))))
         (if (<= y -5.5e+53) t_1 (if (<= y 1.7e+52) (* x (fma 2.0 z t)) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = y * fma(x, 2.0, 5.0);
      	double tmp;
      	if (y <= -5.5e+53) {
      		tmp = t_1;
      	} else if (y <= 1.7e+52) {
      		tmp = x * fma(2.0, z, t);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = Float64(y * fma(x, 2.0, 5.0))
      	tmp = 0.0
      	if (y <= -5.5e+53)
      		tmp = t_1;
      	elseif (y <= 1.7e+52)
      		tmp = Float64(x * fma(2.0, z, t));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+53], t$95$1, If[LessEqual[y, 1.7e+52], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
      \mathbf{if}\;y \leq -5.5 \cdot 10^{+53}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 1.7 \cdot 10^{+52}:\\
      \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -5.49999999999999975e53 or 1.7e52 < y

        1. Initial program 99.9%

          \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto y \cdot \color{blue}{\left(2 \cdot x + 5\right)} \]
          2. metadata-evalN/A

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

            \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
          4. neg-sub0N/A

            \[\leadsto y \cdot \left(\color{blue}{\left(0 - -2 \cdot x\right)} + 5\right) \]
          5. associate--r-N/A

            \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
          6. neg-sub0N/A

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

            \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
          8. neg-sub0N/A

            \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
          9. associate--r-N/A

            \[\leadsto y \cdot \color{blue}{\left(\left(0 - -2 \cdot x\right) + 5\right)} \]
          10. neg-sub0N/A

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

            \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right) \cdot x} + 5\right) \]
          12. metadata-evalN/A

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

            \[\leadsto y \cdot \left(\color{blue}{x \cdot 2} + 5\right) \]
          14. lower-fma.f6480.1

            \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(x, 2, 5\right)} \]
        5. Simplified80.1%

          \[\leadsto \color{blue}{y \cdot \mathsf{fma}\left(x, 2, 5\right)} \]

        if -5.49999999999999975e53 < y < 1.7e52

        1. Initial program 99.9%

          \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
        4. Step-by-step derivation
          1. lower-*.f64N/A

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

            \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
          3. lower-fma.f6480.1

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
        5. Simplified80.1%

          \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, z, t\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 12: 48.4% accurate, 1.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.55 \cdot 10^{-33}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= x -2.55e-33) (* x t) (if (<= x 4.45e-7) (* y 5.0) (* x t))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (x <= -2.55e-33) {
      		tmp = x * t;
      	} else if (x <= 4.45e-7) {
      		tmp = y * 5.0;
      	} else {
      		tmp = x * t;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: tmp
          if (x <= (-2.55d-33)) then
              tmp = x * t
          else if (x <= 4.45d-7) then
              tmp = y * 5.0d0
          else
              tmp = x * t
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (x <= -2.55e-33) {
      		tmp = x * t;
      	} else if (x <= 4.45e-7) {
      		tmp = y * 5.0;
      	} else {
      		tmp = x * t;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if x <= -2.55e-33:
      		tmp = x * t
      	elif x <= 4.45e-7:
      		tmp = y * 5.0
      	else:
      		tmp = x * t
      	return tmp
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (x <= -2.55e-33)
      		tmp = Float64(x * t);
      	elseif (x <= 4.45e-7)
      		tmp = Float64(y * 5.0);
      	else
      		tmp = Float64(x * t);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (x <= -2.55e-33)
      		tmp = x * t;
      	elseif (x <= 4.45e-7)
      		tmp = y * 5.0;
      	else
      		tmp = x * t;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[x, -2.55e-33], N[(x * t), $MachinePrecision], If[LessEqual[x, 4.45e-7], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq -2.55 \cdot 10^{-33}:\\
      \;\;\;\;x \cdot t\\
      
      \mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\
      \;\;\;\;y \cdot 5\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot t\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -2.55000000000000004e-33 or 4.45e-7 < x

        1. Initial program 99.9%

          \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
        2. Add Preprocessing
        3. Taylor expanded in t around inf

          \[\leadsto \color{blue}{t \cdot x} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{x \cdot t} \]
          2. lower-*.f6439.1

            \[\leadsto \color{blue}{x \cdot t} \]
        5. Simplified39.1%

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

        if -2.55000000000000004e-33 < x < 4.45e-7

        1. Initial program 99.9%

          \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{5 \cdot y} \]
        4. Step-by-step derivation
          1. lower-*.f6457.6

            \[\leadsto \color{blue}{5 \cdot y} \]
        5. Simplified57.6%

          \[\leadsto \color{blue}{5 \cdot y} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification48.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.55 \cdot 10^{-33}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 4.45 \cdot 10^{-7}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]
      5. Add Preprocessing

      Alternative 13: 30.3% accurate, 4.3× speedup?

      \[\begin{array}{l} \\ y \cdot 5 \end{array} \]
      (FPCore (x y z t) :precision binary64 (* y 5.0))
      double code(double x, double y, double z, double t) {
      	return y * 5.0;
      }
      
      real(8) function code(x, y, z, t)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          code = y * 5.0d0
      end function
      
      public static double code(double x, double y, double z, double t) {
      	return y * 5.0;
      }
      
      def code(x, y, z, t):
      	return y * 5.0
      
      function code(x, y, z, t)
      	return Float64(y * 5.0)
      end
      
      function tmp = code(x, y, z, t)
      	tmp = y * 5.0;
      end
      
      code[x_, y_, z_, t_] := N[(y * 5.0), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      y \cdot 5
      \end{array}
      
      Derivation
      1. Initial program 99.9%

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{5 \cdot y} \]
      4. Step-by-step derivation
        1. lower-*.f6432.0

          \[\leadsto \color{blue}{5 \cdot y} \]
      5. Simplified32.0%

        \[\leadsto \color{blue}{5 \cdot y} \]
      6. Final simplification32.0%

        \[\leadsto y \cdot 5 \]
      7. Add Preprocessing

      Reproduce

      ?
      herbie shell --seed 2024212 
      (FPCore (x y z t)
        :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
        :precision binary64
        (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))