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

Percentage Accurate: 99.9% → 100.0%
Time: 9.7s
Alternatives: 14
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 14 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: 100.0% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(y + z\right) \cdot 2\right)\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. Step-by-step derivation
    1. +-lowering-+.f64N/A

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    4. associate-+l+N/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    6. count-2N/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    9. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    10. *-lowering-*.f6499.9%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma.f64}\left(y, 5, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right)\right) \]
    7. +-lowering-+.f64100.0%

      \[\leadsto \mathsf{fma.f64}\left(y, 5, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right)\right) \]
  6. Applied egg-rr100.0%

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

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

Alternative 2: 65.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + z \cdot 2\right)\\ t_2 := x \cdot \left(t + y \cdot 2\right)\\ \mathbf{if}\;x \leq -2.05 \cdot 10^{+147}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-63}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{-35}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3 \cdot 10^{+146}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* x (+ t (* y 2.0)))))
   (if (<= x -2.05e+147)
     t_2
     (if (<= x -1.15e-63)
       t_1
       (if (<= x 2.35e-35)
         (* y 5.0)
         (if (<= x 4.2e+53)
           t_1
           (if (<= x 3e+146) (* x (* (+ y z) 2.0)) t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (z * 2.0));
	double t_2 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -2.05e+147) {
		tmp = t_2;
	} else if (x <= -1.15e-63) {
		tmp = t_1;
	} else if (x <= 2.35e-35) {
		tmp = y * 5.0;
	} else if (x <= 4.2e+53) {
		tmp = t_1;
	} else if (x <= 3e+146) {
		tmp = x * ((y + z) * 2.0);
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x * (t + (z * 2.0d0))
    t_2 = x * (t + (y * 2.0d0))
    if (x <= (-2.05d+147)) then
        tmp = t_2
    else if (x <= (-1.15d-63)) then
        tmp = t_1
    else if (x <= 2.35d-35) then
        tmp = y * 5.0d0
    else if (x <= 4.2d+53) then
        tmp = t_1
    else if (x <= 3d+146) then
        tmp = x * ((y + z) * 2.0d0)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (z * 2.0));
	double t_2 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -2.05e+147) {
		tmp = t_2;
	} else if (x <= -1.15e-63) {
		tmp = t_1;
	} else if (x <= 2.35e-35) {
		tmp = y * 5.0;
	} else if (x <= 4.2e+53) {
		tmp = t_1;
	} else if (x <= 3e+146) {
		tmp = x * ((y + z) * 2.0);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (z * 2.0))
	t_2 = x * (t + (y * 2.0))
	tmp = 0
	if x <= -2.05e+147:
		tmp = t_2
	elif x <= -1.15e-63:
		tmp = t_1
	elif x <= 2.35e-35:
		tmp = y * 5.0
	elif x <= 4.2e+53:
		tmp = t_1
	elif x <= 3e+146:
		tmp = x * ((y + z) * 2.0)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(z * 2.0)))
	t_2 = Float64(x * Float64(t + Float64(y * 2.0)))
	tmp = 0.0
	if (x <= -2.05e+147)
		tmp = t_2;
	elseif (x <= -1.15e-63)
		tmp = t_1;
	elseif (x <= 2.35e-35)
		tmp = Float64(y * 5.0);
	elseif (x <= 4.2e+53)
		tmp = t_1;
	elseif (x <= 3e+146)
		tmp = Float64(x * Float64(Float64(y + z) * 2.0));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (z * 2.0));
	t_2 = x * (t + (y * 2.0));
	tmp = 0.0;
	if (x <= -2.05e+147)
		tmp = t_2;
	elseif (x <= -1.15e-63)
		tmp = t_1;
	elseif (x <= 2.35e-35)
		tmp = y * 5.0;
	elseif (x <= 4.2e+53)
		tmp = t_1;
	elseif (x <= 3e+146)
		tmp = x * ((y + z) * 2.0);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.05e+147], t$95$2, If[LessEqual[x, -1.15e-63], t$95$1, If[LessEqual[x, 2.35e-35], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 4.2e+53], t$95$1, If[LessEqual[x, 3e+146], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := x \cdot \left(t + y \cdot 2\right)\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -1.15 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.35 \cdot 10^{-35}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;x \leq 4.2 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 3 \cdot 10^{+146}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.04999999999999983e147 or 3.00000000000000002e146 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f64100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right)\right) \]
      4. +-lowering-+.f64100.0%

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

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

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

        \[\leadsto x \cdot \left(t + \left(\mathsf{neg}\left(-2\right)\right) \cdot y\right) \]
      2. cancel-sign-sub-invN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \color{blue}{\left(2 \cdot y\right)}\right)\right) \]
      7. *-lowering-*.f6482.2%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{y}\right)\right)\right) \]
    10. Simplified82.2%

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

    if -2.04999999999999983e147 < x < -1.15e-63 or 2.35e-35 < x < 4.2000000000000004e53

    1. Initial program 99.8%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \mathsf{*.f64}\left(y, \color{blue}{5}\right)\right) \]
    3. Simplified99.8%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \color{blue}{\left(2 \cdot z\right)}\right)\right) \]
      3. *-lowering-*.f6471.9%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{z}\right)\right)\right) \]
    7. Simplified71.9%

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

    if -1.15e-63 < x < 2.35e-35

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

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

      \[\leadsto \color{blue}{5 \cdot y} \]
    6. Step-by-step derivation
      1. *-lowering-*.f6468.8%

        \[\leadsto \mathsf{*.f64}\left(5, \color{blue}{y}\right) \]
    7. Simplified68.8%

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

    if 4.2000000000000004e53 < x < 3.00000000000000002e146

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right)\right) \]
      4. +-lowering-+.f6499.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(2, \left(z + \color{blue}{y}\right)\right)\right) \]
      7. +-lowering-+.f6489.1%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(2, \mathsf{+.f64}\left(z, \color{blue}{y}\right)\right)\right) \]
    10. Simplified89.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.05 \cdot 10^{+147}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-63}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{-35}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+53}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq 3 \cdot 10^{+146}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 88.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{if}\;x \leq -1.9 \cdot 10^{-5}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-254}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right) + y \cdot 5\\ \mathbf{elif}\;x \leq 65:\\ \;\;\;\;x \cdot t - y \cdot \left(-5 + x \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
   (if (<= x -1.9e-5)
     t_1
     (if (<= x -4.8e-254)
       (+ (* x (* z 2.0)) (* y 5.0))
       (if (<= x 65.0) (- (* x t) (* y (+ -5.0 (* x -2.0)))) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + ((y + z) * 2.0));
	double tmp;
	if (x <= -1.9e-5) {
		tmp = t_1;
	} else if (x <= -4.8e-254) {
		tmp = (x * (z * 2.0)) + (y * 5.0);
	} else if (x <= 65.0) {
		tmp = (x * t) - (y * (-5.0 + (x * -2.0)));
	} 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 * (t + ((y + z) * 2.0d0))
    if (x <= (-1.9d-5)) then
        tmp = t_1
    else if (x <= (-4.8d-254)) then
        tmp = (x * (z * 2.0d0)) + (y * 5.0d0)
    else if (x <= 65.0d0) then
        tmp = (x * t) - (y * ((-5.0d0) + (x * (-2.0d0))))
    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 * (t + ((y + z) * 2.0));
	double tmp;
	if (x <= -1.9e-5) {
		tmp = t_1;
	} else if (x <= -4.8e-254) {
		tmp = (x * (z * 2.0)) + (y * 5.0);
	} else if (x <= 65.0) {
		tmp = (x * t) - (y * (-5.0 + (x * -2.0)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + ((y + z) * 2.0))
	tmp = 0
	if x <= -1.9e-5:
		tmp = t_1
	elif x <= -4.8e-254:
		tmp = (x * (z * 2.0)) + (y * 5.0)
	elif x <= 65.0:
		tmp = (x * t) - (y * (-5.0 + (x * -2.0)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)))
	tmp = 0.0
	if (x <= -1.9e-5)
		tmp = t_1;
	elseif (x <= -4.8e-254)
		tmp = Float64(Float64(x * Float64(z * 2.0)) + Float64(y * 5.0));
	elseif (x <= 65.0)
		tmp = Float64(Float64(x * t) - Float64(y * Float64(-5.0 + Float64(x * -2.0))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + ((y + z) * 2.0));
	tmp = 0.0;
	if (x <= -1.9e-5)
		tmp = t_1;
	elseif (x <= -4.8e-254)
		tmp = (x * (z * 2.0)) + (y * 5.0);
	elseif (x <= 65.0)
		tmp = (x * t) - (y * (-5.0 + (x * -2.0)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.9e-5], t$95$1, If[LessEqual[x, -4.8e-254], N[(N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 65.0], N[(N[(x * t), $MachinePrecision] - N[(y * N[(-5.0 + N[(x * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -4.8 \cdot 10^{-254}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right) + y \cdot 5\\

\mathbf{elif}\;x \leq 65:\\
\;\;\;\;x \cdot t - y \cdot \left(-5 + x \cdot -2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.9000000000000001e-5 or 65 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right)\right) \]
      4. +-lowering-+.f6498.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \mathsf{+.f64}\left(y, \color{blue}{z}\right)\right)\right)\right) \]
    7. Simplified98.8%

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

    if -1.9000000000000001e-5 < x < -4.80000000000000003e-254

    1. Initial program 99.8%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \mathsf{*.f64}\left(y, \color{blue}{5}\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(2 \cdot \left(x \cdot z\right)\right)}, \mathsf{*.f64}\left(y, 5\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(2 \cdot z\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, 5\right)\right) \]
      5. *-lowering-*.f6483.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(2, z\right)\right), \mathsf{*.f64}\left(y, 5\right)\right) \]
    7. Simplified83.9%

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

    if -4.80000000000000003e-254 < x < 65

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

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

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

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

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

        \[\leadsto \left(t \cdot x + x \cdot \left(2 \cdot y\right)\right) + 5 \cdot y \]
      4. associate-+l+N/A

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

        \[\leadsto t \cdot x + \left(x \cdot \left(y \cdot 2\right) + 5 \cdot y\right) \]
      6. associate-*r*N/A

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

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

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

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

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

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

        \[\leadsto t \cdot x + \left(\left(\mathsf{neg}\left(y \cdot \left(-2 \cdot x\right)\right)\right) + \left(-5 \cdot -1\right) \cdot y\right) \]
      13. associate-*r*N/A

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

        \[\leadsto t \cdot x + \left(\left(\mathsf{neg}\left(y \cdot \left(-2 \cdot x\right)\right)\right) + -5 \cdot \left(\mathsf{neg}\left(y\right)\right)\right) \]
      15. distribute-rgt-neg-outN/A

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

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

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

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

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

        \[\leadsto t \cdot x + \left(\mathsf{neg}\left(y \cdot \left(-2 \cdot x - 5\right)\right)\right) \]
    7. Simplified86.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{-5}:\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-254}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right) + y \cdot 5\\ \mathbf{elif}\;x \leq 65:\\ \;\;\;\;x \cdot t - y \cdot \left(-5 + x \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 88.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{if}\;x \leq -3.4 \cdot 10^{-5}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-244}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right) + y \cdot 5\\ \mathbf{elif}\;x \leq 3.1:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right) + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
   (if (<= x -3.4e-5)
     t_1
     (if (<= x -8e-244)
       (+ (* x (* z 2.0)) (* y 5.0))
       (if (<= x 3.1) (+ (* x (+ t (* y 2.0))) (* y 5.0)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + ((y + z) * 2.0));
	double tmp;
	if (x <= -3.4e-5) {
		tmp = t_1;
	} else if (x <= -8e-244) {
		tmp = (x * (z * 2.0)) + (y * 5.0);
	} else if (x <= 3.1) {
		tmp = (x * (t + (y * 2.0))) + (y * 5.0);
	} 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 * (t + ((y + z) * 2.0d0))
    if (x <= (-3.4d-5)) then
        tmp = t_1
    else if (x <= (-8d-244)) then
        tmp = (x * (z * 2.0d0)) + (y * 5.0d0)
    else if (x <= 3.1d0) then
        tmp = (x * (t + (y * 2.0d0))) + (y * 5.0d0)
    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 * (t + ((y + z) * 2.0));
	double tmp;
	if (x <= -3.4e-5) {
		tmp = t_1;
	} else if (x <= -8e-244) {
		tmp = (x * (z * 2.0)) + (y * 5.0);
	} else if (x <= 3.1) {
		tmp = (x * (t + (y * 2.0))) + (y * 5.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + ((y + z) * 2.0))
	tmp = 0
	if x <= -3.4e-5:
		tmp = t_1
	elif x <= -8e-244:
		tmp = (x * (z * 2.0)) + (y * 5.0)
	elif x <= 3.1:
		tmp = (x * (t + (y * 2.0))) + (y * 5.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)))
	tmp = 0.0
	if (x <= -3.4e-5)
		tmp = t_1;
	elseif (x <= -8e-244)
		tmp = Float64(Float64(x * Float64(z * 2.0)) + Float64(y * 5.0));
	elseif (x <= 3.1)
		tmp = Float64(Float64(x * Float64(t + Float64(y * 2.0))) + Float64(y * 5.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + ((y + z) * 2.0));
	tmp = 0.0;
	if (x <= -3.4e-5)
		tmp = t_1;
	elseif (x <= -8e-244)
		tmp = (x * (z * 2.0)) + (y * 5.0);
	elseif (x <= 3.1)
		tmp = (x * (t + (y * 2.0))) + (y * 5.0);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-5], t$95$1, If[LessEqual[x, -8e-244], N[(N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1], N[(N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -8 \cdot 10^{-244}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right) + y \cdot 5\\

\mathbf{elif}\;x \leq 3.1:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right) + y \cdot 5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.4e-5 or 3.10000000000000009 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right)\right) \]
      4. +-lowering-+.f6498.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \mathsf{+.f64}\left(y, \color{blue}{z}\right)\right)\right)\right) \]
    7. Simplified98.8%

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

    if -3.4e-5 < x < -7.9999999999999994e-244

    1. Initial program 99.8%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \mathsf{*.f64}\left(y, \color{blue}{5}\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(2 \cdot \left(x \cdot z\right)\right)}, \mathsf{*.f64}\left(y, 5\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(2 \cdot z\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, 5\right)\right) \]
      5. *-lowering-*.f6483.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(2, z\right)\right), \mathsf{*.f64}\left(y, 5\right)\right) \]
    7. Simplified83.9%

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

    if -7.9999999999999994e-244 < x < 3.10000000000000009

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(y \cdot 2\right), t\right)\right), \mathsf{*.f64}\left(y, 5\right)\right) \]
      2. *-lowering-*.f6486.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), t\right)\right), \mathsf{*.f64}\left(y, 5\right)\right) \]
    7. Simplified86.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-5}:\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-244}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right) + y \cdot 5\\ \mathbf{elif}\;x \leq 3.1:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right) + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 47.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(y \cdot 2\right)\\ \mathbf{if}\;x \leq -7.6 \cdot 10^{+146}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -3 \cdot 10^{-6}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-33}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+83}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (* y 2.0))))
   (if (<= x -7.6e+146)
     t_1
     (if (<= x -3e-6)
       (* x t)
       (if (<= x 1.2e-33) (* y 5.0) (if (<= x 4.2e+83) (* x t) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (y * 2.0);
	double tmp;
	if (x <= -7.6e+146) {
		tmp = t_1;
	} else if (x <= -3e-6) {
		tmp = x * t;
	} else if (x <= 1.2e-33) {
		tmp = y * 5.0;
	} else if (x <= 4.2e+83) {
		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 * 2.0d0)
    if (x <= (-7.6d+146)) then
        tmp = t_1
    else if (x <= (-3d-6)) then
        tmp = x * t
    else if (x <= 1.2d-33) then
        tmp = y * 5.0d0
    else if (x <= 4.2d+83) 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 * 2.0);
	double tmp;
	if (x <= -7.6e+146) {
		tmp = t_1;
	} else if (x <= -3e-6) {
		tmp = x * t;
	} else if (x <= 1.2e-33) {
		tmp = y * 5.0;
	} else if (x <= 4.2e+83) {
		tmp = x * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (y * 2.0)
	tmp = 0
	if x <= -7.6e+146:
		tmp = t_1
	elif x <= -3e-6:
		tmp = x * t
	elif x <= 1.2e-33:
		tmp = y * 5.0
	elif x <= 4.2e+83:
		tmp = x * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(y * 2.0))
	tmp = 0.0
	if (x <= -7.6e+146)
		tmp = t_1;
	elseif (x <= -3e-6)
		tmp = Float64(x * t);
	elseif (x <= 1.2e-33)
		tmp = Float64(y * 5.0);
	elseif (x <= 4.2e+83)
		tmp = Float64(x * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (y * 2.0);
	tmp = 0.0;
	if (x <= -7.6e+146)
		tmp = t_1;
	elseif (x <= -3e-6)
		tmp = x * t;
	elseif (x <= 1.2e-33)
		tmp = y * 5.0;
	elseif (x <= 4.2e+83)
		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 * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.6e+146], t$95$1, If[LessEqual[x, -3e-6], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.2e-33], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 4.2e+83], N[(x * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot 2\right)\\
\mathbf{if}\;x \leq -7.6 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -3 \cdot 10^{-6}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-33}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;x \leq 4.2 \cdot 10^{+83}:\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.59999999999999958e146 or 4.20000000000000005e83 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f64100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right)\right) \]
      4. +-lowering-+.f64100.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(2, \color{blue}{y}\right)\right) \]
    10. Simplified50.1%

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

    if -7.59999999999999958e146 < x < -3.0000000000000001e-6 or 1.2e-33 < x < 4.20000000000000005e83

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{t}\right) \]
    7. Simplified43.5%

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

    if -3.0000000000000001e-6 < x < 1.2e-33

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

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

      \[\leadsto \color{blue}{5 \cdot y} \]
    6. Step-by-step derivation
      1. *-lowering-*.f6464.3%

        \[\leadsto \mathsf{*.f64}\left(5, \color{blue}{y}\right) \]
    7. Simplified64.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.6 \cdot 10^{+146}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \mathbf{elif}\;x \leq -3 \cdot 10^{-6}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-33}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+83}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 88.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{-5}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-248}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right) + y \cdot 5\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-34}:\\ \;\;\;\;x \cdot t + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
   (if (<= x -1.35e-5)
     t_1
     (if (<= x -1.2e-248)
       (+ (* x (* z 2.0)) (* y 5.0))
       (if (<= x 5.5e-34) (+ (* x t) (* y 5.0)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + ((y + z) * 2.0));
	double tmp;
	if (x <= -1.35e-5) {
		tmp = t_1;
	} else if (x <= -1.2e-248) {
		tmp = (x * (z * 2.0)) + (y * 5.0);
	} else if (x <= 5.5e-34) {
		tmp = (x * t) + (y * 5.0);
	} 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 * (t + ((y + z) * 2.0d0))
    if (x <= (-1.35d-5)) then
        tmp = t_1
    else if (x <= (-1.2d-248)) then
        tmp = (x * (z * 2.0d0)) + (y * 5.0d0)
    else if (x <= 5.5d-34) then
        tmp = (x * t) + (y * 5.0d0)
    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 * (t + ((y + z) * 2.0));
	double tmp;
	if (x <= -1.35e-5) {
		tmp = t_1;
	} else if (x <= -1.2e-248) {
		tmp = (x * (z * 2.0)) + (y * 5.0);
	} else if (x <= 5.5e-34) {
		tmp = (x * t) + (y * 5.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + ((y + z) * 2.0))
	tmp = 0
	if x <= -1.35e-5:
		tmp = t_1
	elif x <= -1.2e-248:
		tmp = (x * (z * 2.0)) + (y * 5.0)
	elif x <= 5.5e-34:
		tmp = (x * t) + (y * 5.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)))
	tmp = 0.0
	if (x <= -1.35e-5)
		tmp = t_1;
	elseif (x <= -1.2e-248)
		tmp = Float64(Float64(x * Float64(z * 2.0)) + Float64(y * 5.0));
	elseif (x <= 5.5e-34)
		tmp = Float64(Float64(x * t) + Float64(y * 5.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + ((y + z) * 2.0));
	tmp = 0.0;
	if (x <= -1.35e-5)
		tmp = t_1;
	elseif (x <= -1.2e-248)
		tmp = (x * (z * 2.0)) + (y * 5.0);
	elseif (x <= 5.5e-34)
		tmp = (x * t) + (y * 5.0);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e-5], t$95$1, If[LessEqual[x, -1.2e-248], N[(N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e-34], N[(N[(x * t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.2 \cdot 10^{-248}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right) + y \cdot 5\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-34}:\\
\;\;\;\;x \cdot t + y \cdot 5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.3499999999999999e-5 or 5.50000000000000014e-34 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right)\right) \]
      4. +-lowering-+.f6496.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \mathsf{+.f64}\left(y, \color{blue}{z}\right)\right)\right)\right) \]
    7. Simplified96.8%

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

    if -1.3499999999999999e-5 < x < -1.20000000000000002e-248

    1. Initial program 99.8%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \mathsf{*.f64}\left(y, \color{blue}{5}\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(2 \cdot \left(x \cdot z\right)\right)}, \mathsf{*.f64}\left(y, 5\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(2 \cdot z\right)\right), \mathsf{*.f64}\left(\color{blue}{y}, 5\right)\right) \]
      5. *-lowering-*.f6483.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(2, z\right)\right), \mathsf{*.f64}\left(y, 5\right)\right) \]
    7. Simplified83.9%

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

    if -1.20000000000000002e-248 < x < 5.50000000000000014e-34

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

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

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot t\right), \mathsf{*.f64}\left(\color{blue}{y}, 5\right)\right) \]
      2. *-lowering-*.f6489.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, t\right), \mathsf{*.f64}\left(\color{blue}{y}, 5\right)\right) \]
    7. Simplified89.2%

      \[\leadsto \color{blue}{x \cdot t} + y \cdot 5 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{-5}:\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-248}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right) + y \cdot 5\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-34}:\\ \;\;\;\;x \cdot t + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -1 \cdot 10^{+100}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.04 \cdot 10^{-38}:\\ \;\;\;\;x \cdot t + y \cdot 5\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+145}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
   (if (<= y -1e+100)
     t_1
     (if (<= y -1.04e-38)
       (+ (* x t) (* y 5.0))
       (if (<= y 4.8e+145) (* x (+ t (* z 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -1e+100) {
		tmp = t_1;
	} else if (y <= -1.04e-38) {
		tmp = (x * t) + (y * 5.0);
	} else if (y <= 4.8e+145) {
		tmp = x * (t + (z * 2.0));
	} 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 = y * (5.0d0 + (x * 2.0d0))
    if (y <= (-1d+100)) then
        tmp = t_1
    else if (y <= (-1.04d-38)) then
        tmp = (x * t) + (y * 5.0d0)
    else if (y <= 4.8d+145) then
        tmp = x * (t + (z * 2.0d0))
    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 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -1e+100) {
		tmp = t_1;
	} else if (y <= -1.04e-38) {
		tmp = (x * t) + (y * 5.0);
	} else if (y <= 4.8e+145) {
		tmp = x * (t + (z * 2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (5.0 + (x * 2.0))
	tmp = 0
	if y <= -1e+100:
		tmp = t_1
	elif y <= -1.04e-38:
		tmp = (x * t) + (y * 5.0)
	elif y <= 4.8e+145:
		tmp = x * (t + (z * 2.0))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0)))
	tmp = 0.0
	if (y <= -1e+100)
		tmp = t_1;
	elseif (y <= -1.04e-38)
		tmp = Float64(Float64(x * t) + Float64(y * 5.0));
	elseif (y <= 4.8e+145)
		tmp = Float64(x * Float64(t + Float64(z * 2.0)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (5.0 + (x * 2.0));
	tmp = 0.0;
	if (y <= -1e+100)
		tmp = t_1;
	elseif (y <= -1.04e-38)
		tmp = (x * t) + (y * 5.0);
	elseif (y <= 4.8e+145)
		tmp = x * (t + (z * 2.0));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+100], t$95$1, If[LessEqual[y, -1.04e-38], N[(N[(x * t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+145], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.04 \cdot 10^{-38}:\\
\;\;\;\;x \cdot t + y \cdot 5\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{+145}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.00000000000000002e100 or 4.79999999999999984e145 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(5, \left(x \cdot \color{blue}{2}\right)\right)\right) \]
      4. *-lowering-*.f6488.3%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(5, \mathsf{*.f64}\left(x, \color{blue}{2}\right)\right)\right) \]
    7. Simplified88.3%

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

    if -1.00000000000000002e100 < y < -1.04e-38

    1. Initial program 99.8%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \mathsf{*.f64}\left(y, \color{blue}{5}\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

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

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot t\right), \mathsf{*.f64}\left(\color{blue}{y}, 5\right)\right) \]
      2. *-lowering-*.f6468.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, t\right), \mathsf{*.f64}\left(\color{blue}{y}, 5\right)\right) \]
    7. Simplified68.1%

      \[\leadsto \color{blue}{x \cdot t} + y \cdot 5 \]

    if -1.04e-38 < y < 4.79999999999999984e145

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \color{blue}{\left(2 \cdot z\right)}\right)\right) \]
      3. *-lowering-*.f6480.0%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{z}\right)\right)\right) \]
    7. Simplified80.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+100}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq -1.04 \cdot 10^{-38}:\\ \;\;\;\;x \cdot t + y \cdot 5\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+145}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 89.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{if}\;x \leq -4.4 \cdot 10^{-13}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-33}:\\ \;\;\;\;x \cdot t + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
   (if (<= x -4.4e-13) t_1 (if (<= x 1.5e-33) (+ (* x t) (* y 5.0)) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + ((y + z) * 2.0));
	double tmp;
	if (x <= -4.4e-13) {
		tmp = t_1;
	} else if (x <= 1.5e-33) {
		tmp = (x * t) + (y * 5.0);
	} 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 * (t + ((y + z) * 2.0d0))
    if (x <= (-4.4d-13)) then
        tmp = t_1
    else if (x <= 1.5d-33) then
        tmp = (x * t) + (y * 5.0d0)
    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 * (t + ((y + z) * 2.0));
	double tmp;
	if (x <= -4.4e-13) {
		tmp = t_1;
	} else if (x <= 1.5e-33) {
		tmp = (x * t) + (y * 5.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + ((y + z) * 2.0))
	tmp = 0
	if x <= -4.4e-13:
		tmp = t_1
	elif x <= 1.5e-33:
		tmp = (x * t) + (y * 5.0)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)))
	tmp = 0.0
	if (x <= -4.4e-13)
		tmp = t_1;
	elseif (x <= 1.5e-33)
		tmp = Float64(Float64(x * t) + Float64(y * 5.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + ((y + z) * 2.0));
	tmp = 0.0;
	if (x <= -4.4e-13)
		tmp = t_1;
	elseif (x <= 1.5e-33)
		tmp = (x * t) + (y * 5.0);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e-13], t$95$1, If[LessEqual[x, 1.5e-33], N[(N[(x * t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 1.5 \cdot 10^{-33}:\\
\;\;\;\;x \cdot t + y \cdot 5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.39999999999999993e-13 or 1.5000000000000001e-33 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right)\right) \]
      4. +-lowering-+.f6496.2%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \mathsf{+.f64}\left(y, \color{blue}{z}\right)\right)\right)\right) \]
    7. Simplified96.2%

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

    if -4.39999999999999993e-13 < x < 1.5000000000000001e-33

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

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

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot t\right), \mathsf{*.f64}\left(\color{blue}{y}, 5\right)\right) \]
      2. *-lowering-*.f6482.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, t\right), \mathsf{*.f64}\left(\color{blue}{y}, 5\right)\right) \]
    7. Simplified82.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.4 \cdot 10^{-13}:\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-33}:\\ \;\;\;\;x \cdot t + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 75.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -2.6 \cdot 10^{-37}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+145}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
   (if (<= y -2.6e-37) t_1 (if (<= y 4.9e+145) (* x (+ t (* z 2.0))) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -2.6e-37) {
		tmp = t_1;
	} else if (y <= 4.9e+145) {
		tmp = x * (t + (z * 2.0));
	} 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 = y * (5.0d0 + (x * 2.0d0))
    if (y <= (-2.6d-37)) then
        tmp = t_1
    else if (y <= 4.9d+145) then
        tmp = x * (t + (z * 2.0d0))
    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 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -2.6e-37) {
		tmp = t_1;
	} else if (y <= 4.9e+145) {
		tmp = x * (t + (z * 2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (5.0 + (x * 2.0))
	tmp = 0
	if y <= -2.6e-37:
		tmp = t_1
	elif y <= 4.9e+145:
		tmp = x * (t + (z * 2.0))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0)))
	tmp = 0.0
	if (y <= -2.6e-37)
		tmp = t_1;
	elseif (y <= 4.9e+145)
		tmp = Float64(x * Float64(t + Float64(z * 2.0)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (5.0 + (x * 2.0));
	tmp = 0.0;
	if (y <= -2.6e-37)
		tmp = t_1;
	elseif (y <= 4.9e+145)
		tmp = x * (t + (z * 2.0));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.6e-37], t$95$1, If[LessEqual[y, 4.9e+145], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 4.9 \cdot 10^{+145}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.5999999999999998e-37 or 4.90000000000000003e145 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \mathsf{*.f64}\left(y, \color{blue}{5}\right)\right) \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(5, \left(x \cdot \color{blue}{2}\right)\right)\right) \]
      4. *-lowering-*.f6480.3%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(5, \mathsf{*.f64}\left(x, \color{blue}{2}\right)\right)\right) \]
    7. Simplified80.3%

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

    if -2.5999999999999998e-37 < y < 4.90000000000000003e145

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \color{blue}{\left(2 \cdot z\right)}\right)\right) \]
      3. *-lowering-*.f6480.0%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{z}\right)\right)\right) \]
    7. Simplified80.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-37}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+145}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 63.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + y \cdot 2\right)\\ \mathbf{if}\;x \leq -3.4 \cdot 10^{-5}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-33}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* y 2.0)))))
   (if (<= x -3.4e-5) t_1 (if (<= x 1.4e-33) (* y 5.0) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -3.4e-5) {
		tmp = t_1;
	} else if (x <= 1.4e-33) {
		tmp = y * 5.0;
	} 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 * (t + (y * 2.0d0))
    if (x <= (-3.4d-5)) then
        tmp = t_1
    else if (x <= 1.4d-33) then
        tmp = y * 5.0d0
    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 * (t + (y * 2.0));
	double tmp;
	if (x <= -3.4e-5) {
		tmp = t_1;
	} else if (x <= 1.4e-33) {
		tmp = y * 5.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (y * 2.0))
	tmp = 0
	if x <= -3.4e-5:
		tmp = t_1
	elif x <= 1.4e-33:
		tmp = y * 5.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(y * 2.0)))
	tmp = 0.0
	if (x <= -3.4e-5)
		tmp = t_1;
	elseif (x <= 1.4e-33)
		tmp = Float64(y * 5.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (y * 2.0));
	tmp = 0.0;
	if (x <= -3.4e-5)
		tmp = t_1;
	elseif (x <= 1.4e-33)
		tmp = y * 5.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-5], t$95$1, If[LessEqual[x, 1.4e-33], N[(y * 5.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 1.4 \cdot 10^{-33}:\\
\;\;\;\;y \cdot 5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.4e-5 or 1.4e-33 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right)\right) \]
      4. +-lowering-+.f6496.8%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \mathsf{+.f64}\left(y, \color{blue}{z}\right)\right)\right)\right) \]
    7. Simplified96.8%

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

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

        \[\leadsto x \cdot \left(t + \left(\mathsf{neg}\left(-2\right)\right) \cdot y\right) \]
      2. cancel-sign-sub-invN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \color{blue}{\left(2 \cdot y\right)}\right)\right) \]
      7. *-lowering-*.f6472.1%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{y}\right)\right)\right) \]
    10. Simplified72.1%

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

    if -3.4e-5 < x < 1.4e-33

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

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

      \[\leadsto \color{blue}{5 \cdot y} \]
    6. Step-by-step derivation
      1. *-lowering-*.f6464.3%

        \[\leadsto \mathsf{*.f64}\left(5, \color{blue}{y}\right) \]
    7. Simplified64.3%

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

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

Alternative 11: 62.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{if}\;x \leq -9.5 \cdot 10^{-63}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.7 \cdot 10^{-28}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (* (+ y z) 2.0))))
   (if (<= x -9.5e-63) t_1 (if (<= x 4.7e-28) (* y 5.0) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y + z) * 2.0);
	double tmp;
	if (x <= -9.5e-63) {
		tmp = t_1;
	} else if (x <= 4.7e-28) {
		tmp = y * 5.0;
	} 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 + z) * 2.0d0)
    if (x <= (-9.5d-63)) then
        tmp = t_1
    else if (x <= 4.7d-28) then
        tmp = y * 5.0d0
    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 + z) * 2.0);
	double tmp;
	if (x <= -9.5e-63) {
		tmp = t_1;
	} else if (x <= 4.7e-28) {
		tmp = y * 5.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y + z) * 2.0)
	tmp = 0
	if x <= -9.5e-63:
		tmp = t_1
	elif x <= 4.7e-28:
		tmp = y * 5.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y + z) * 2.0))
	tmp = 0.0
	if (x <= -9.5e-63)
		tmp = t_1;
	elseif (x <= 4.7e-28)
		tmp = Float64(y * 5.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y + z) * 2.0);
	tmp = 0.0;
	if (x <= -9.5e-63)
		tmp = t_1;
	elseif (x <= 4.7e-28)
		tmp = y * 5.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e-63], t$95$1, If[LessEqual[x, 4.7e-28], N[(y * 5.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 4.7 \cdot 10^{-28}:\\
\;\;\;\;y \cdot 5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.50000000000000016e-63 or 4.6999999999999996e-28 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right)\right) \]
      4. +-lowering-+.f6493.9%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(t, \mathsf{*.f64}\left(2, \mathsf{+.f64}\left(y, \color{blue}{z}\right)\right)\right)\right) \]
    7. Simplified93.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(2, \color{blue}{\left(y + z\right)}\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(2, \left(z + \color{blue}{y}\right)\right)\right) \]
      7. +-lowering-+.f6465.4%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(2, \mathsf{+.f64}\left(z, \color{blue}{y}\right)\right)\right) \]
    10. Simplified65.4%

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

    if -9.50000000000000016e-63 < x < 4.6999999999999996e-28

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

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

      \[\leadsto \color{blue}{5 \cdot y} \]
    6. Step-by-step derivation
      1. *-lowering-*.f6468.1%

        \[\leadsto \mathsf{*.f64}\left(5, \color{blue}{y}\right) \]
    7. Simplified68.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.5 \cdot 10^{-63}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;x \leq 4.7 \cdot 10^{-28}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 47.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9.6 \cdot 10^{-6}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-33}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -9.6e-6) (* x t) (if (<= x 1.5e-33) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -9.6e-6) {
		tmp = x * t;
	} else if (x <= 1.5e-33) {
		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 <= (-9.6d-6)) then
        tmp = x * t
    else if (x <= 1.5d-33) 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 <= -9.6e-6) {
		tmp = x * t;
	} else if (x <= 1.5e-33) {
		tmp = y * 5.0;
	} else {
		tmp = x * t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -9.6e-6:
		tmp = x * t
	elif x <= 1.5e-33:
		tmp = y * 5.0
	else:
		tmp = x * t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -9.6e-6)
		tmp = Float64(x * t);
	elseif (x <= 1.5e-33)
		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 <= -9.6e-6)
		tmp = x * t;
	elseif (x <= 1.5e-33)
		tmp = y * 5.0;
	else
		tmp = x * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.6e-6], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.5e-33], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{-6}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{-33}:\\
\;\;\;\;y \cdot 5\\

\mathbf{else}:\\
\;\;\;\;x \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.5999999999999996e-6 or 1.5000000000000001e-33 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

      \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf

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

        \[\leadsto x \cdot \color{blue}{t} \]
      2. *-lowering-*.f6436.7%

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{t}\right) \]
    7. Simplified36.7%

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

    if -9.5999999999999996e-6 < x < 1.5000000000000001e-33

    1. Initial program 99.9%

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      4. associate-+l+N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      6. count-2N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
      10. *-lowering-*.f6499.9%

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

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

      \[\leadsto \color{blue}{5 \cdot y} \]
    6. Step-by-step derivation
      1. *-lowering-*.f6464.3%

        \[\leadsto \mathsf{*.f64}\left(5, \color{blue}{y}\right) \]
    7. Simplified64.3%

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

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

Alternative 13: 99.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ x \cdot \left(t + \left(y + z\right) \cdot 2\right) + y \cdot 5 \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ (* x (+ t (* (+ y z) 2.0))) (* y 5.0)))
double code(double x, double y, double z, double t) {
	return (x * (t + ((y + z) * 2.0))) + (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 * (t + ((y + z) * 2.0d0))) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
	return (x * (t + ((y + z) * 2.0))) + (y * 5.0);
}
def code(x, y, z, t):
	return (x * (t + ((y + z) * 2.0))) + (y * 5.0)
function code(x, y, z, t)
	return Float64(Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) + Float64(y * 5.0))
end
function tmp = code(x, y, z, t)
	tmp = (x * (t + ((y + z) * 2.0))) + (y * 5.0);
end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(t + \left(y + z\right) \cdot 2\right) + 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. Step-by-step derivation
    1. +-lowering-+.f64N/A

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    4. associate-+l+N/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    6. count-2N/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    9. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    10. *-lowering-*.f6499.9%

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

    \[\leadsto \color{blue}{x \cdot \left(\left(y + z\right) \cdot 2 + t\right) + y \cdot 5} \]
  4. Add Preprocessing
  5. Final simplification99.9%

    \[\leadsto x \cdot \left(t + \left(y + z\right) \cdot 2\right) + y \cdot 5 \]
  6. Add Preprocessing

Alternative 14: 29.3% accurate, 5.0× 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. Step-by-step derivation
    1. +-lowering-+.f64N/A

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(\left(y + z\right) + z\right) + y\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    4. associate-+l+N/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) + \left(y + z\right)\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    6. count-2N/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\left(y + z\right) \cdot 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(y + z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    9. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(y, z\right), 2\right), t\right)\right), \left(y \cdot 5\right)\right) \]
    10. *-lowering-*.f6499.9%

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

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

    \[\leadsto \color{blue}{5 \cdot y} \]
  6. Step-by-step derivation
    1. *-lowering-*.f6429.8%

      \[\leadsto \mathsf{*.f64}\left(5, \color{blue}{y}\right) \]
  7. Simplified29.8%

    \[\leadsto \color{blue}{5 \cdot y} \]
  8. Final simplification29.8%

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

Reproduce

?
herbie shell --seed 2024158 
(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)))