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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 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: 73.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq -1.55 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 1.42 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.15000000000000002e80

    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. *-lowering-*.f64N/A

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

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

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

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

    if -2.15000000000000002e80 < x < -1.55000000000000009e-78 or 1.7e-15 < x < 1.42000000000000013e92

    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 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.2%

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

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

    if -1.55000000000000009e-78 < x < 1.7e-15

    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-*.f6480.6%

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

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

    if 1.42000000000000013e92 < 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 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-+.f6479.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.15 \cdot 10^{+80}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq -1.55 \cdot 10^{-78}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;x \leq 1.42 \cdot 10^{+92}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 65.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq -2.6 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.8 \cdot 10^{-142}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;x \leq 1.7 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -6.40000000000000005e79

    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. *-lowering-*.f64N/A

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

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

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

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

    if -6.40000000000000005e79 < x < -2.60000000000000003e-173 or 1.8e-142 < x < 1.6999999999999999e92

    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-*.f6470.1%

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

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

    if -2.60000000000000003e-173 < x < 1.8e-142

    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-*.f6469.5%

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

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

    if 1.6999999999999999e92 < 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 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-+.f6479.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.4 \cdot 10^{+79}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{-173}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-142}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+92}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 47.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(y \cdot 2\right)\\ \mathbf{if}\;x \leq -1.3 \cdot 10^{+214}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -9 \cdot 10^{-14}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 1.24 \cdot 10^{+92}:\\ \;\;\;\;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 -1.3e+214)
     t_1
     (if (<= x -9e-14)
       (* x t)
       (if (<= x 1.1e-11) (* y 5.0) (if (<= x 1.24e+92) (* 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 <= -1.3e+214) {
		tmp = t_1;
	} else if (x <= -9e-14) {
		tmp = x * t;
	} else if (x <= 1.1e-11) {
		tmp = y * 5.0;
	} else if (x <= 1.24e+92) {
		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 <= (-1.3d+214)) then
        tmp = t_1
    else if (x <= (-9d-14)) then
        tmp = x * t
    else if (x <= 1.1d-11) then
        tmp = y * 5.0d0
    else if (x <= 1.24d+92) 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 <= -1.3e+214) {
		tmp = t_1;
	} else if (x <= -9e-14) {
		tmp = x * t;
	} else if (x <= 1.1e-11) {
		tmp = y * 5.0;
	} else if (x <= 1.24e+92) {
		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 <= -1.3e+214:
		tmp = t_1
	elif x <= -9e-14:
		tmp = x * t
	elif x <= 1.1e-11:
		tmp = y * 5.0
	elif x <= 1.24e+92:
		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 <= -1.3e+214)
		tmp = t_1;
	elseif (x <= -9e-14)
		tmp = Float64(x * t);
	elseif (x <= 1.1e-11)
		tmp = Float64(y * 5.0);
	elseif (x <= 1.24e+92)
		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 <= -1.3e+214)
		tmp = t_1;
	elseif (x <= -9e-14)
		tmp = x * t;
	elseif (x <= 1.1e-11)
		tmp = y * 5.0;
	elseif (x <= 1.24e+92)
		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, -1.3e+214], t$95$1, If[LessEqual[x, -9e-14], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.1e-11], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.24e+92], 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 -1.3 \cdot 10^{+214}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -9 \cdot 10^{-14}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;x \leq 1.24 \cdot 10^{+92}:\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.29999999999999996e214 or 1.23999999999999999e92 < 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-*.f6451.8%

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

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

    if -1.29999999999999996e214 < x < -8.9999999999999995e-14 or 1.1000000000000001e-11 < x < 1.23999999999999999e92

    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 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-*.f6445.9%

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

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

    if -8.9999999999999995e-14 < x < 1.1000000000000001e-11

    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-*.f6457.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+214}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \mathbf{elif}\;x \leq -9 \cdot 10^{-14}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-11}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 1.24 \cdot 10^{+92}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.69999999999999978e129 or 1.85e19 < t

    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 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-*.f6485.9%

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

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

    if -3.69999999999999978e129 < t < 1.85e19

    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 0

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

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

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

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

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

Alternative 6: 87.7% 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 -8.8 \cdot 10^{-79}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-14}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \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 -8.8e-79) t_1 (if (<= x 4.8e-14) (+ (* y 5.0) (* x t)) 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 <= -8.8e-79) {
		tmp = t_1;
	} else if (x <= 4.8e-14) {
		tmp = (y * 5.0) + (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 * (t + ((y + z) * 2.0d0))
    if (x <= (-8.8d-79)) then
        tmp = t_1
    else if (x <= 4.8d-14) then
        tmp = (y * 5.0d0) + (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 * (t + ((y + z) * 2.0));
	double tmp;
	if (x <= -8.8e-79) {
		tmp = t_1;
	} else if (x <= 4.8e-14) {
		tmp = (y * 5.0) + (x * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + ((y + z) * 2.0))
	tmp = 0
	if x <= -8.8e-79:
		tmp = t_1
	elif x <= 4.8e-14:
		tmp = (y * 5.0) + (x * t)
	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 <= -8.8e-79)
		tmp = t_1;
	elseif (x <= 4.8e-14)
		tmp = Float64(Float64(y * 5.0) + Float64(x * t));
	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 <= -8.8e-79)
		tmp = t_1;
	elseif (x <= 4.8e-14)
		tmp = (y * 5.0) + (x * t);
	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, -8.8e-79], t$95$1, If[LessEqual[x, 4.8e-14], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $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 -8.8 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.7999999999999995e-79 or 4.8e-14 < 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-+.f6497.4%

        \[\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. Simplified97.4%

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

    if -8.7999999999999995e-79 < x < 4.8e-14

    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-*.f6480.6%

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

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

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

Alternative 7: 77.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -3.9 \cdot 10^{-17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.62 \cdot 10^{+94}:\\ \;\;\;\;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 -3.9e-17) t_1 (if (<= y 1.62e+94) (* 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 <= -3.9e-17) {
		tmp = t_1;
	} else if (y <= 1.62e+94) {
		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 <= (-3.9d-17)) then
        tmp = t_1
    else if (y <= 1.62d+94) 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 <= -3.9e-17) {
		tmp = t_1;
	} else if (y <= 1.62e+94) {
		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 <= -3.9e-17:
		tmp = t_1
	elif y <= 1.62e+94:
		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 <= -3.9e-17)
		tmp = t_1;
	elseif (y <= 1.62e+94)
		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 <= -3.9e-17)
		tmp = t_1;
	elseif (y <= 1.62e+94)
		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, -3.9e-17], t$95$1, If[LessEqual[y, 1.62e+94], 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 -3.9 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.62 \cdot 10^{+94}:\\
\;\;\;\;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 < -3.89999999999999989e-17 or 1.61999999999999997e94 < 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-*.f6474.4%

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

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

    if -3.89999999999999989e-17 < y < 1.61999999999999997e94

    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 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-*.f6475.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{-17}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq 1.62 \cdot 10^{+94}:\\ \;\;\;\;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: 58.9% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.48e91 or 1.6000000000000001e-83 < t

    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-+.f6477.5%

        \[\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. Simplified77.5%

      \[\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. *-lowering-*.f64N/A

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

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

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

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

    if -1.48e91 < t < 1.6000000000000001e-83

    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-+.f6469.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. Simplified69.8%

      \[\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-+.f6466.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.48 \cdot 10^{+91}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;t \leq 1.6 \cdot 10^{-83}:\\ \;\;\;\;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 9: 58.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{+129}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+19}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -5.8e+129)
   (* x t)
   (if (<= t 1.25e+19) (* x (* (+ y z) 2.0)) (* x t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -5.8e+129) {
		tmp = x * t;
	} else if (t <= 1.25e+19) {
		tmp = x * ((y + z) * 2.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 (t <= (-5.8d+129)) then
        tmp = x * t
    else if (t <= 1.25d+19) then
        tmp = x * ((y + z) * 2.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 (t <= -5.8e+129) {
		tmp = x * t;
	} else if (t <= 1.25e+19) {
		tmp = x * ((y + z) * 2.0);
	} else {
		tmp = x * t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -5.8e+129:
		tmp = x * t
	elif t <= 1.25e+19:
		tmp = x * ((y + z) * 2.0)
	else:
		tmp = x * t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -5.8e+129)
		tmp = Float64(x * t);
	elseif (t <= 1.25e+19)
		tmp = Float64(x * Float64(Float64(y + z) * 2.0));
	else
		tmp = Float64(x * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -5.8e+129)
		tmp = x * t;
	elseif (t <= 1.25e+19)
		tmp = x * ((y + z) * 2.0);
	else
		tmp = x * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.8e+129], N[(x * t), $MachinePrecision], If[LessEqual[t, 1.25e+19], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+129}:\\
\;\;\;\;x \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.80000000000000005e129 or 1.25e19 < t

    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 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-*.f6467.2%

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

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

    if -5.80000000000000005e129 < t < 1.25e19

    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-+.f6468.3%

        \[\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. Simplified68.3%

      \[\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-+.f6462.5%

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

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

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

Alternative 10: 44.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.4 \cdot 10^{+91}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;t \leq 9.5 \cdot 10^{-67}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.39999999999999979e91 or 9.4999999999999994e-67 < t

    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 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-*.f6460.5%

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

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

    if -6.39999999999999979e91 < t < 9.4999999999999994e-67

    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 inf

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

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

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

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

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

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

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

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

Alternative 11: 47.9% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.50000000000000028e-10 or 4.7e-7 < 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 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-*.f6439.0%

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

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

    if -9.50000000000000028e-10 < x < 4.7e-7

    1. Initial program 99.9%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. 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-*.f6457.1%

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

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

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

Alternative 12: 99.9% accurate, 1.2× speedup?

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

\\
y \cdot 5 + x \cdot \left(t + \left(y + z\right) \cdot 2\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. Final simplification99.9%

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

Alternative 13: 29.8% 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-*.f6428.1%

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

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

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

Reproduce

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