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

Percentage Accurate: 99.8% → 99.9%
Time: 8.3s
Alternatives: 16
Speedup: 1.0×

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 16 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot 2 + t\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. +-commutative99.9%

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

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

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t\right)\right) \]
    4. *-un-lft-identity100.0%

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

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
    6. *-un-lft-identity100.0%

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
    7. distribute-rgt-out100.0%

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
    8. metadata-eval100.0%

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

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

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

Alternative 2: 42.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(x \cdot z\right)\\ \mathbf{if}\;t \leq -1.12 \cdot 10^{+100}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-119}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq -1.75 \cdot 10^{-222}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1.25 \cdot 10^{-291}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{-254}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-225}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-188}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-159}:\\ \;\;\;\;\frac{y}{0.2}\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-34}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (* x z))))
   (if (<= t -1.12e+100)
     (* x t)
     (if (<= t -8e-119)
       (* y 5.0)
       (if (<= t -1.75e-222)
         t_1
         (if (<= t -1.25e-291)
           (* y 5.0)
           (if (<= t 1.56e-254)
             t_1
             (if (<= t 5.2e-225)
               (* y 5.0)
               (if (<= t 8.5e-188)
                 (* y x)
                 (if (<= t 1.8e-159)
                   (/ y 0.2)
                   (if (<= t 9e-34) t_1 (* x t))))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * (x * z);
	double tmp;
	if (t <= -1.12e+100) {
		tmp = x * t;
	} else if (t <= -8e-119) {
		tmp = y * 5.0;
	} else if (t <= -1.75e-222) {
		tmp = t_1;
	} else if (t <= -1.25e-291) {
		tmp = y * 5.0;
	} else if (t <= 1.56e-254) {
		tmp = t_1;
	} else if (t <= 5.2e-225) {
		tmp = y * 5.0;
	} else if (t <= 8.5e-188) {
		tmp = y * x;
	} else if (t <= 1.8e-159) {
		tmp = y / 0.2;
	} else if (t <= 9e-34) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = 2.0d0 * (x * z)
    if (t <= (-1.12d+100)) then
        tmp = x * t
    else if (t <= (-8d-119)) then
        tmp = y * 5.0d0
    else if (t <= (-1.75d-222)) then
        tmp = t_1
    else if (t <= (-1.25d-291)) then
        tmp = y * 5.0d0
    else if (t <= 1.56d-254) then
        tmp = t_1
    else if (t <= 5.2d-225) then
        tmp = y * 5.0d0
    else if (t <= 8.5d-188) then
        tmp = y * x
    else if (t <= 1.8d-159) then
        tmp = y / 0.2d0
    else if (t <= 9d-34) then
        tmp = t_1
    else
        tmp = x * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * (x * z);
	double tmp;
	if (t <= -1.12e+100) {
		tmp = x * t;
	} else if (t <= -8e-119) {
		tmp = y * 5.0;
	} else if (t <= -1.75e-222) {
		tmp = t_1;
	} else if (t <= -1.25e-291) {
		tmp = y * 5.0;
	} else if (t <= 1.56e-254) {
		tmp = t_1;
	} else if (t <= 5.2e-225) {
		tmp = y * 5.0;
	} else if (t <= 8.5e-188) {
		tmp = y * x;
	} else if (t <= 1.8e-159) {
		tmp = y / 0.2;
	} else if (t <= 9e-34) {
		tmp = t_1;
	} else {
		tmp = x * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 * (x * z)
	tmp = 0
	if t <= -1.12e+100:
		tmp = x * t
	elif t <= -8e-119:
		tmp = y * 5.0
	elif t <= -1.75e-222:
		tmp = t_1
	elif t <= -1.25e-291:
		tmp = y * 5.0
	elif t <= 1.56e-254:
		tmp = t_1
	elif t <= 5.2e-225:
		tmp = y * 5.0
	elif t <= 8.5e-188:
		tmp = y * x
	elif t <= 1.8e-159:
		tmp = y / 0.2
	elif t <= 9e-34:
		tmp = t_1
	else:
		tmp = x * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 * Float64(x * z))
	tmp = 0.0
	if (t <= -1.12e+100)
		tmp = Float64(x * t);
	elseif (t <= -8e-119)
		tmp = Float64(y * 5.0);
	elseif (t <= -1.75e-222)
		tmp = t_1;
	elseif (t <= -1.25e-291)
		tmp = Float64(y * 5.0);
	elseif (t <= 1.56e-254)
		tmp = t_1;
	elseif (t <= 5.2e-225)
		tmp = Float64(y * 5.0);
	elseif (t <= 8.5e-188)
		tmp = Float64(y * x);
	elseif (t <= 1.8e-159)
		tmp = Float64(y / 0.2);
	elseif (t <= 9e-34)
		tmp = t_1;
	else
		tmp = Float64(x * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 * (x * z);
	tmp = 0.0;
	if (t <= -1.12e+100)
		tmp = x * t;
	elseif (t <= -8e-119)
		tmp = y * 5.0;
	elseif (t <= -1.75e-222)
		tmp = t_1;
	elseif (t <= -1.25e-291)
		tmp = y * 5.0;
	elseif (t <= 1.56e-254)
		tmp = t_1;
	elseif (t <= 5.2e-225)
		tmp = y * 5.0;
	elseif (t <= 8.5e-188)
		tmp = y * x;
	elseif (t <= 1.8e-159)
		tmp = y / 0.2;
	elseif (t <= 9e-34)
		tmp = t_1;
	else
		tmp = x * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.12e+100], N[(x * t), $MachinePrecision], If[LessEqual[t, -8e-119], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, -1.75e-222], t$95$1, If[LessEqual[t, -1.25e-291], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 1.56e-254], t$95$1, If[LessEqual[t, 5.2e-225], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 8.5e-188], N[(y * x), $MachinePrecision], If[LessEqual[t, 1.8e-159], N[(y / 0.2), $MachinePrecision], If[LessEqual[t, 9e-34], t$95$1, N[(x * t), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -8 \cdot 10^{-119}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;t \leq -1.75 \cdot 10^{-222}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -1.25 \cdot 10^{-291}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;t \leq 1.56 \cdot 10^{-254}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 5.2 \cdot 10^{-225}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;t \leq 8.5 \cdot 10^{-188}:\\
\;\;\;\;y \cdot x\\

\mathbf{elif}\;t \leq 1.8 \cdot 10^{-159}:\\
\;\;\;\;\frac{y}{0.2}\\

\mathbf{elif}\;t \leq 9 \cdot 10^{-34}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.12e100 or 9.00000000000000085e-34 < 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. Taylor expanded in t around inf 68.3%

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

    if -1.12e100 < t < -8.0000000000000001e-119 or -1.75000000000000012e-222 < t < -1.2500000000000001e-291 or 1.56e-254 < t < 5.20000000000000027e-225

    1. Initial program 99.9%

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

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

    if -8.0000000000000001e-119 < t < -1.75000000000000012e-222 or -1.2500000000000001e-291 < t < 1.56e-254 or 1.80000000000000011e-159 < t < 9.00000000000000085e-34

    1. Initial program 100.0%

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

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

    if 5.20000000000000027e-225 < t < 8.5000000000000004e-188

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(5 + x\right)} \]
    5. Taylor expanded in x around inf 59.1%

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

    if 8.5000000000000004e-188 < t < 1.80000000000000011e-159

    1. Initial program 99.6%

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

      \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
    3. Simplified84.1%

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

        \[\leadsto \color{blue}{\left(5 + x \cdot 2\right) \cdot y} \]
      2. flip-+70.6%

        \[\leadsto \color{blue}{\frac{5 \cdot 5 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)}{5 - x \cdot 2}} \cdot y \]
      3. associate-*l/57.3%

        \[\leadsto \color{blue}{\frac{\left(5 \cdot 5 - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)\right) \cdot y}{5 - x \cdot 2}} \]
      4. metadata-eval57.3%

        \[\leadsto \frac{\left(\color{blue}{25} - \left(x \cdot 2\right) \cdot \left(x \cdot 2\right)\right) \cdot y}{5 - x \cdot 2} \]
      5. swap-sqr57.3%

        \[\leadsto \frac{\left(25 - \color{blue}{\left(x \cdot x\right) \cdot \left(2 \cdot 2\right)}\right) \cdot y}{5 - x \cdot 2} \]
      6. metadata-eval57.3%

        \[\leadsto \frac{\left(25 - \left(x \cdot x\right) \cdot \color{blue}{4}\right) \cdot y}{5 - x \cdot 2} \]
    5. Applied egg-rr57.3%

      \[\leadsto \color{blue}{\frac{\left(25 - \left(x \cdot x\right) \cdot 4\right) \cdot y}{5 - x \cdot 2}} \]
    6. Taylor expanded in y around 0 57.3%

      \[\leadsto \color{blue}{\frac{y \cdot \left(25 - 4 \cdot {x}^{2}\right)}{5 - 2 \cdot x}} \]
    7. Step-by-step derivation
      1. associate-/l*70.6%

        \[\leadsto \color{blue}{\frac{y}{\frac{5 - 2 \cdot x}{25 - 4 \cdot {x}^{2}}}} \]
      2. cancel-sign-sub-inv70.6%

        \[\leadsto \frac{y}{\frac{\color{blue}{5 + \left(-2\right) \cdot x}}{25 - 4 \cdot {x}^{2}}} \]
      3. metadata-eval70.6%

        \[\leadsto \frac{y}{\frac{5 + \color{blue}{-2} \cdot x}{25 - 4 \cdot {x}^{2}}} \]
      4. *-commutative70.6%

        \[\leadsto \frac{y}{\frac{5 + \color{blue}{x \cdot -2}}{25 - 4 \cdot {x}^{2}}} \]
      5. cancel-sign-sub-inv70.6%

        \[\leadsto \frac{y}{\frac{5 + x \cdot -2}{\color{blue}{25 + \left(-4\right) \cdot {x}^{2}}}} \]
      6. metadata-eval70.6%

        \[\leadsto \frac{y}{\frac{5 + x \cdot -2}{25 + \color{blue}{-4} \cdot {x}^{2}}} \]
      7. unpow270.6%

        \[\leadsto \frac{y}{\frac{5 + x \cdot -2}{25 + -4 \cdot \color{blue}{\left(x \cdot x\right)}}} \]
    8. Simplified70.6%

      \[\leadsto \color{blue}{\frac{y}{\frac{5 + x \cdot -2}{25 + -4 \cdot \left(x \cdot x\right)}}} \]
    9. Taylor expanded in x around 0 55.8%

      \[\leadsto \frac{y}{\color{blue}{0.2}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification59.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.12 \cdot 10^{+100}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-119}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq -1.75 \cdot 10^{-222}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;t \leq -1.25 \cdot 10^{-291}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{-254}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-225}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-188}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-159}:\\ \;\;\;\;\frac{y}{0.2}\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-34}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]

Alternative 3: 48.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(x \cdot z\right)\\ t_2 := y \cdot \left(5 + x\right)\\ \mathbf{if}\;t \leq -2.05 \cdot 10^{+102}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq -1.55 \cdot 10^{-149}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -5.6 \cdot 10^{-195}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{-299}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 6.4 \cdot 10^{-254}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-158}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{-33}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (* x z))) (t_2 (* y (+ 5.0 x))))
   (if (<= t -2.05e+102)
     (* x t)
     (if (<= t -1.55e-149)
       t_2
       (if (<= t -5.6e-195)
         t_1
         (if (<= t 1.1e-299)
           t_2
           (if (<= t 6.4e-254)
             t_1
             (if (<= t 6.8e-158) t_2 (if (<= t 2.2e-33) t_1 (* x t))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * (x * z);
	double t_2 = y * (5.0 + x);
	double tmp;
	if (t <= -2.05e+102) {
		tmp = x * t;
	} else if (t <= -1.55e-149) {
		tmp = t_2;
	} else if (t <= -5.6e-195) {
		tmp = t_1;
	} else if (t <= 1.1e-299) {
		tmp = t_2;
	} else if (t <= 6.4e-254) {
		tmp = t_1;
	} else if (t <= 6.8e-158) {
		tmp = t_2;
	} else if (t <= 2.2e-33) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 * (x * z)
    t_2 = y * (5.0d0 + x)
    if (t <= (-2.05d+102)) then
        tmp = x * t
    else if (t <= (-1.55d-149)) then
        tmp = t_2
    else if (t <= (-5.6d-195)) then
        tmp = t_1
    else if (t <= 1.1d-299) then
        tmp = t_2
    else if (t <= 6.4d-254) then
        tmp = t_1
    else if (t <= 6.8d-158) then
        tmp = t_2
    else if (t <= 2.2d-33) then
        tmp = t_1
    else
        tmp = x * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * (x * z);
	double t_2 = y * (5.0 + x);
	double tmp;
	if (t <= -2.05e+102) {
		tmp = x * t;
	} else if (t <= -1.55e-149) {
		tmp = t_2;
	} else if (t <= -5.6e-195) {
		tmp = t_1;
	} else if (t <= 1.1e-299) {
		tmp = t_2;
	} else if (t <= 6.4e-254) {
		tmp = t_1;
	} else if (t <= 6.8e-158) {
		tmp = t_2;
	} else if (t <= 2.2e-33) {
		tmp = t_1;
	} else {
		tmp = x * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 * (x * z)
	t_2 = y * (5.0 + x)
	tmp = 0
	if t <= -2.05e+102:
		tmp = x * t
	elif t <= -1.55e-149:
		tmp = t_2
	elif t <= -5.6e-195:
		tmp = t_1
	elif t <= 1.1e-299:
		tmp = t_2
	elif t <= 6.4e-254:
		tmp = t_1
	elif t <= 6.8e-158:
		tmp = t_2
	elif t <= 2.2e-33:
		tmp = t_1
	else:
		tmp = x * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 * Float64(x * z))
	t_2 = Float64(y * Float64(5.0 + x))
	tmp = 0.0
	if (t <= -2.05e+102)
		tmp = Float64(x * t);
	elseif (t <= -1.55e-149)
		tmp = t_2;
	elseif (t <= -5.6e-195)
		tmp = t_1;
	elseif (t <= 1.1e-299)
		tmp = t_2;
	elseif (t <= 6.4e-254)
		tmp = t_1;
	elseif (t <= 6.8e-158)
		tmp = t_2;
	elseif (t <= 2.2e-33)
		tmp = t_1;
	else
		tmp = Float64(x * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 * (x * z);
	t_2 = y * (5.0 + x);
	tmp = 0.0;
	if (t <= -2.05e+102)
		tmp = x * t;
	elseif (t <= -1.55e-149)
		tmp = t_2;
	elseif (t <= -5.6e-195)
		tmp = t_1;
	elseif (t <= 1.1e-299)
		tmp = t_2;
	elseif (t <= 6.4e-254)
		tmp = t_1;
	elseif (t <= 6.8e-158)
		tmp = t_2;
	elseif (t <= 2.2e-33)
		tmp = t_1;
	else
		tmp = x * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.05e+102], N[(x * t), $MachinePrecision], If[LessEqual[t, -1.55e-149], t$95$2, If[LessEqual[t, -5.6e-195], t$95$1, If[LessEqual[t, 1.1e-299], t$95$2, If[LessEqual[t, 6.4e-254], t$95$1, If[LessEqual[t, 6.8e-158], t$95$2, If[LessEqual[t, 2.2e-33], t$95$1, N[(x * t), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.55 \cdot 10^{-149}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq -5.6 \cdot 10^{-195}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{-299}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 6.4 \cdot 10^{-254}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 6.8 \cdot 10^{-158}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 2.2 \cdot 10^{-33}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.05e102 or 2.20000000000000005e-33 < 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. Taylor expanded in t around inf 68.3%

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

    if -2.05e102 < t < -1.54999999999999994e-149 or -5.60000000000000007e-195 < t < 1.1e-299 or 6.4e-254 < t < 6.7999999999999999e-158

    1. Initial program 99.9%

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

      \[\leadsto x \cdot \left(\left(\color{blue}{2 \cdot z} + y\right) + t\right) + y \cdot 5 \]
    3. Simplified88.6%

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

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

    if -1.54999999999999994e-149 < t < -5.60000000000000007e-195 or 1.1e-299 < t < 6.4e-254 or 6.7999999999999999e-158 < t < 2.20000000000000005e-33

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.05 \cdot 10^{+102}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq -1.55 \cdot 10^{-149}:\\ \;\;\;\;y \cdot \left(5 + x\right)\\ \mathbf{elif}\;t \leq -5.6 \cdot 10^{-195}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{-299}:\\ \;\;\;\;y \cdot \left(5 + x\right)\\ \mathbf{elif}\;t \leq 6.4 \cdot 10^{-254}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-158}:\\ \;\;\;\;y \cdot \left(5 + x\right)\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{-33}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]

Alternative 4: 77.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot 5 + x \cdot \left(y + t\right)\\ \mathbf{if}\;y \leq -3.6 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -4.3 \cdot 10^{+54}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;y \leq -3.35 \cdot 10^{-18} \lor \neg \left(y \leq 5 \cdot 10^{-14}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (* y 5.0) (* x (+ y t)))))
   (if (<= y -3.6e+89)
     t_1
     (if (<= y -4.3e+54)
       (* x (* (+ y z) 2.0))
       (if (or (<= y -3.35e-18) (not (<= y 5e-14)))
         t_1
         (* x (+ t (* z 2.0))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y * 5.0) + (x * (y + t));
	double tmp;
	if (y <= -3.6e+89) {
		tmp = t_1;
	} else if (y <= -4.3e+54) {
		tmp = x * ((y + z) * 2.0);
	} else if ((y <= -3.35e-18) || !(y <= 5e-14)) {
		tmp = t_1;
	} else {
		tmp = x * (t + (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 = (y * 5.0d0) + (x * (y + t))
    if (y <= (-3.6d+89)) then
        tmp = t_1
    else if (y <= (-4.3d+54)) then
        tmp = x * ((y + z) * 2.0d0)
    else if ((y <= (-3.35d-18)) .or. (.not. (y <= 5d-14))) then
        tmp = t_1
    else
        tmp = x * (t + (z * 2.0d0))
    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 * (y + t));
	double tmp;
	if (y <= -3.6e+89) {
		tmp = t_1;
	} else if (y <= -4.3e+54) {
		tmp = x * ((y + z) * 2.0);
	} else if ((y <= -3.35e-18) || !(y <= 5e-14)) {
		tmp = t_1;
	} else {
		tmp = x * (t + (z * 2.0));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y * 5.0) + (x * (y + t))
	tmp = 0
	if y <= -3.6e+89:
		tmp = t_1
	elif y <= -4.3e+54:
		tmp = x * ((y + z) * 2.0)
	elif (y <= -3.35e-18) or not (y <= 5e-14):
		tmp = t_1
	else:
		tmp = x * (t + (z * 2.0))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y * 5.0) + Float64(x * Float64(y + t)))
	tmp = 0.0
	if (y <= -3.6e+89)
		tmp = t_1;
	elseif (y <= -4.3e+54)
		tmp = Float64(x * Float64(Float64(y + z) * 2.0));
	elseif ((y <= -3.35e-18) || !(y <= 5e-14))
		tmp = t_1;
	else
		tmp = Float64(x * Float64(t + Float64(z * 2.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y * 5.0) + (x * (y + t));
	tmp = 0.0;
	if (y <= -3.6e+89)
		tmp = t_1;
	elseif (y <= -4.3e+54)
		tmp = x * ((y + z) * 2.0);
	elseif ((y <= -3.35e-18) || ~((y <= 5e-14)))
		tmp = t_1;
	else
		tmp = x * (t + (z * 2.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e+89], t$95$1, If[LessEqual[y, -4.3e+54], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -3.35e-18], N[Not[LessEqual[y, 5e-14]], $MachinePrecision]], t$95$1, N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -3.35 \cdot 10^{-18} \lor \neg \left(y \leq 5 \cdot 10^{-14}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.6e89 or -4.29999999999999976e54 < y < -3.3499999999999999e-18 or 5.0000000000000002e-14 < 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. Taylor expanded in y around 0 91.1%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(y + t\right)} + y \cdot 5 \]
    6. Simplified83.4%

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

    if -3.6e89 < y < -4.29999999999999976e54

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot y} + 2 \cdot \left(x \cdot z\right) \]
      2. associate-*r*87.7%

        \[\leadsto \left(2 \cdot x\right) \cdot y + \color{blue}{\left(2 \cdot x\right) \cdot z} \]
      3. distribute-lft-in87.7%

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot \left(y + z\right)} \]
      4. *-commutative87.7%

        \[\leadsto \color{blue}{\left(x \cdot 2\right)} \cdot \left(y + z\right) \]
      5. associate-*r*87.7%

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

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

    if -3.3499999999999999e-18 < y < 5.0000000000000002e-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. Taylor expanded in y around 0 82.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{+89}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(y + t\right)\\ \mathbf{elif}\;y \leq -4.3 \cdot 10^{+54}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;y \leq -3.35 \cdot 10^{-18} \lor \neg \left(y \leq 5 \cdot 10^{-14}\right):\\ \;\;\;\;y \cdot 5 + x \cdot \left(y + t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \end{array} \]

Alternative 5: 99.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.5 \lor \neg \left(x \leq 3.5 \cdot 10^{-9}\right):\\ \;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + \left(z + z\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -2.5) (not (<= x 3.5e-9)))
   (* x (+ t (+ (* y 2.0) (* z 2.0))))
   (+ (* y 5.0) (* x (+ t (+ y (+ z z)))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -2.5) || !(x <= 3.5e-9)) {
		tmp = x * (t + ((y * 2.0) + (z * 2.0)));
	} else {
		tmp = (y * 5.0) + (x * (t + (y + (z + z))));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x <= (-2.5d0)) .or. (.not. (x <= 3.5d-9))) then
        tmp = x * (t + ((y * 2.0d0) + (z * 2.0d0)))
    else
        tmp = (y * 5.0d0) + (x * (t + (y + (z + z))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -2.5) || !(x <= 3.5e-9)) {
		tmp = x * (t + ((y * 2.0) + (z * 2.0)));
	} else {
		tmp = (y * 5.0) + (x * (t + (y + (z + z))));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -2.5) or not (x <= 3.5e-9):
		tmp = x * (t + ((y * 2.0) + (z * 2.0)))
	else:
		tmp = (y * 5.0) + (x * (t + (y + (z + z))))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -2.5) || !(x <= 3.5e-9))
		tmp = Float64(x * Float64(t + Float64(Float64(y * 2.0) + Float64(z * 2.0))));
	else
		tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y + Float64(z + z)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -2.5) || ~((x <= 3.5e-9)))
		tmp = x * (t + ((y * 2.0) + (z * 2.0)));
	else
		tmp = (y * 5.0) + (x * (t + (y + (z + z))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.5], N[Not[LessEqual[x, 3.5e-9]], $MachinePrecision]], N[(x * N[(t + N[(N[(y * 2.0), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \lor \neg \left(x \leq 3.5 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.5 or 3.4999999999999999e-9 < 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. Taylor expanded in x around inf 99.3%

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

    if -2.5 < x < 3.4999999999999999e-9

    1. Initial program 99.8%

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

      \[\leadsto x \cdot \left(\left(\color{blue}{2 \cdot z} + y\right) + t\right) + y \cdot 5 \]
    3. Simplified99.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \lor \neg \left(x \leq 3.5 \cdot 10^{-9}\right):\\ \;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(t + \left(y + \left(z + z\right)\right)\right)\\ \end{array} \]

Alternative 6: 64.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + y \cdot 2\right)\\ \mathbf{if}\;x \leq -3.9 \cdot 10^{+158}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -9.6 \cdot 10^{+86}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-57} \lor \neg \left(x \leq 1.48 \cdot 10^{-89}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* y 2.0)))))
   (if (<= x -3.9e+158)
     t_1
     (if (<= x -9.6e+86)
       (* x (* (+ y z) 2.0))
       (if (or (<= x -2.5e-57) (not (<= x 1.48e-89))) t_1 (* y 5.0))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -3.9e+158) {
		tmp = t_1;
	} else if (x <= -9.6e+86) {
		tmp = x * ((y + z) * 2.0);
	} else if ((x <= -2.5e-57) || !(x <= 1.48e-89)) {
		tmp = t_1;
	} else {
		tmp = y * 5.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 + (y * 2.0d0))
    if (x <= (-3.9d+158)) then
        tmp = t_1
    else if (x <= (-9.6d+86)) then
        tmp = x * ((y + z) * 2.0d0)
    else if ((x <= (-2.5d-57)) .or. (.not. (x <= 1.48d-89))) then
        tmp = t_1
    else
        tmp = y * 5.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -3.9e+158) {
		tmp = t_1;
	} else if (x <= -9.6e+86) {
		tmp = x * ((y + z) * 2.0);
	} else if ((x <= -2.5e-57) || !(x <= 1.48e-89)) {
		tmp = t_1;
	} else {
		tmp = y * 5.0;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (y * 2.0))
	tmp = 0
	if x <= -3.9e+158:
		tmp = t_1
	elif x <= -9.6e+86:
		tmp = x * ((y + z) * 2.0)
	elif (x <= -2.5e-57) or not (x <= 1.48e-89):
		tmp = t_1
	else:
		tmp = y * 5.0
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(y * 2.0)))
	tmp = 0.0
	if (x <= -3.9e+158)
		tmp = t_1;
	elseif (x <= -9.6e+86)
		tmp = Float64(x * Float64(Float64(y + z) * 2.0));
	elseif ((x <= -2.5e-57) || !(x <= 1.48e-89))
		tmp = t_1;
	else
		tmp = Float64(y * 5.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (y * 2.0));
	tmp = 0.0;
	if (x <= -3.9e+158)
		tmp = t_1;
	elseif (x <= -9.6e+86)
		tmp = x * ((y + z) * 2.0);
	elseif ((x <= -2.5e-57) || ~((x <= 1.48e-89)))
		tmp = t_1;
	else
		tmp = y * 5.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e+158], t$95$1, If[LessEqual[x, -9.6e+86], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -2.5e-57], N[Not[LessEqual[x, 1.48e-89]], $MachinePrecision]], t$95$1, N[(y * 5.0), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq -2.5 \cdot 10^{-57} \lor \neg \left(x \leq 1.48 \cdot 10^{-89}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;y \cdot 5\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.9e158 or -9.6000000000000001e86 < x < -2.5000000000000001e-57 or 1.48000000000000007e-89 < 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. Taylor expanded in y around inf 73.8%

      \[\leadsto x \cdot \left(\left(\color{blue}{y} + y\right) + t\right) + y \cdot 5 \]
    3. Taylor expanded in x around inf 69.3%

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

    if -3.9e158 < x < -9.6000000000000001e86

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot y} + 2 \cdot \left(x \cdot z\right) \]
      2. associate-*r*94.1%

        \[\leadsto \left(2 \cdot x\right) \cdot y + \color{blue}{\left(2 \cdot x\right) \cdot z} \]
      3. distribute-lft-in94.1%

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot \left(y + z\right)} \]
      4. *-commutative94.1%

        \[\leadsto \color{blue}{\left(x \cdot 2\right)} \cdot \left(y + z\right) \]
      5. associate-*r*94.1%

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

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

    if -2.5000000000000001e-57 < x < 1.48000000000000007e-89

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.9 \cdot 10^{+158}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq -9.6 \cdot 10^{+86}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-57} \lor \neg \left(x \leq 1.48 \cdot 10^{-89}\right):\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]

Alternative 7: 69.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(5 + x\right)\\ \mathbf{if}\;y \leq -2.6 \cdot 10^{+92}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-13}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+84} \lor \neg \left(y \leq 2.7 \cdot 10^{+264}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (+ 5.0 x))))
   (if (<= y -2.6e+92)
     t_1
     (if (<= y 1.9e-13)
       (* x (+ t (* z 2.0)))
       (if (or (<= y 2.2e+84) (not (<= y 2.7e+264)))
         t_1
         (* x (+ t (* y 2.0))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (5.0 + x);
	double tmp;
	if (y <= -2.6e+92) {
		tmp = t_1;
	} else if (y <= 1.9e-13) {
		tmp = x * (t + (z * 2.0));
	} else if ((y <= 2.2e+84) || !(y <= 2.7e+264)) {
		tmp = t_1;
	} else {
		tmp = x * (t + (y * 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 = y * (5.0d0 + x)
    if (y <= (-2.6d+92)) then
        tmp = t_1
    else if (y <= 1.9d-13) then
        tmp = x * (t + (z * 2.0d0))
    else if ((y <= 2.2d+84) .or. (.not. (y <= 2.7d+264))) then
        tmp = t_1
    else
        tmp = x * (t + (y * 2.0d0))
    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);
	double tmp;
	if (y <= -2.6e+92) {
		tmp = t_1;
	} else if (y <= 1.9e-13) {
		tmp = x * (t + (z * 2.0));
	} else if ((y <= 2.2e+84) || !(y <= 2.7e+264)) {
		tmp = t_1;
	} else {
		tmp = x * (t + (y * 2.0));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (5.0 + x)
	tmp = 0
	if y <= -2.6e+92:
		tmp = t_1
	elif y <= 1.9e-13:
		tmp = x * (t + (z * 2.0))
	elif (y <= 2.2e+84) or not (y <= 2.7e+264):
		tmp = t_1
	else:
		tmp = x * (t + (y * 2.0))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(5.0 + x))
	tmp = 0.0
	if (y <= -2.6e+92)
		tmp = t_1;
	elseif (y <= 1.9e-13)
		tmp = Float64(x * Float64(t + Float64(z * 2.0)));
	elseif ((y <= 2.2e+84) || !(y <= 2.7e+264))
		tmp = t_1;
	else
		tmp = Float64(x * Float64(t + Float64(y * 2.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (5.0 + x);
	tmp = 0.0;
	if (y <= -2.6e+92)
		tmp = t_1;
	elseif (y <= 1.9e-13)
		tmp = x * (t + (z * 2.0));
	elseif ((y <= 2.2e+84) || ~((y <= 2.7e+264)))
		tmp = t_1;
	else
		tmp = x * (t + (y * 2.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.6e+92], t$95$1, If[LessEqual[y, 1.9e-13], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 2.2e+84], N[Not[LessEqual[y, 2.7e+264]], $MachinePrecision]], t$95$1, N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+84} \lor \neg \left(y \leq 2.7 \cdot 10^{+264}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.5999999999999999e92 or 1.9e-13 < y < 2.1999999999999998e84 or 2.7000000000000002e264 < 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. Taylor expanded in y around 0 91.9%

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

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

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

    if -2.5999999999999999e92 < y < 1.9e-13

    1. Initial program 99.9%

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

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

    if 2.1999999999999998e84 < y < 2.7000000000000002e264

    1. Initial program 100.0%

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

      \[\leadsto x \cdot \left(\left(\color{blue}{y} + y\right) + t\right) + y \cdot 5 \]
    3. Taylor expanded in x around inf 70.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+92}:\\ \;\;\;\;y \cdot \left(5 + x\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-13}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+84} \lor \neg \left(y \leq 2.7 \cdot 10^{+264}\right):\\ \;\;\;\;y \cdot \left(5 + x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \end{array} \]

Alternative 8: 56.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 3.5 \cdot 10^{-253}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 3.5 \cdot 10^{-227}:\\
\;\;\;\;y \cdot \left(5 + x\right)\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{+37}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.9999999999999997e98 or 1.34999999999999993e37 < 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. Taylor expanded in t around inf 70.6%

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

    if -9.9999999999999997e98 < t < 3.50000000000000022e-253 or 3.5000000000000001e-227 < t < 1.34999999999999993e37

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot y} + 2 \cdot \left(x \cdot z\right) \]
      2. associate-*r*60.3%

        \[\leadsto \left(2 \cdot x\right) \cdot y + \color{blue}{\left(2 \cdot x\right) \cdot z} \]
      3. distribute-lft-in63.7%

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot \left(y + z\right)} \]
      4. *-commutative63.7%

        \[\leadsto \color{blue}{\left(x \cdot 2\right)} \cdot \left(y + z\right) \]
      5. associate-*r*63.7%

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

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

    if 3.50000000000000022e-253 < t < 3.5000000000000001e-227

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{+99}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-253}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-227}:\\ \;\;\;\;y \cdot \left(5 + x\right)\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+37}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]

Alternative 9: 86.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-55} \lor \neg \left(x \leq 6.5 \cdot 10^{-146}\right):\\ \;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(y + t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -1.15e-55) (not (<= x 6.5e-146)))
   (* x (+ t (+ (* y 2.0) (* z 2.0))))
   (+ (* y 5.0) (* x (+ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.15e-55) || !(x <= 6.5e-146)) {
		tmp = x * (t + ((y * 2.0) + (z * 2.0)));
	} else {
		tmp = (y * 5.0) + (x * (y + 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 <= (-1.15d-55)) .or. (.not. (x <= 6.5d-146))) then
        tmp = x * (t + ((y * 2.0d0) + (z * 2.0d0)))
    else
        tmp = (y * 5.0d0) + (x * (y + t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.15e-55) || !(x <= 6.5e-146)) {
		tmp = x * (t + ((y * 2.0) + (z * 2.0)));
	} else {
		tmp = (y * 5.0) + (x * (y + t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -1.15e-55) or not (x <= 6.5e-146):
		tmp = x * (t + ((y * 2.0) + (z * 2.0)))
	else:
		tmp = (y * 5.0) + (x * (y + t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -1.15e-55) || !(x <= 6.5e-146))
		tmp = Float64(x * Float64(t + Float64(Float64(y * 2.0) + Float64(z * 2.0))));
	else
		tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(y + t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -1.15e-55) || ~((x <= 6.5e-146)))
		tmp = x * (t + ((y * 2.0) + (z * 2.0)));
	else
		tmp = (y * 5.0) + (x * (y + t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.15e-55], N[Not[LessEqual[x, 6.5e-146]], $MachinePrecision]], N[(x * N[(t + N[(N[(y * 2.0), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-55} \lor \neg \left(x \leq 6.5 \cdot 10^{-146}\right):\\
\;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(y + t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15000000000000006e-55 or 6.4999999999999999e-146 < 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. Taylor expanded in x around inf 95.5%

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

    if -1.15000000000000006e-55 < x < 6.4999999999999999e-146

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(y + t\right)} + y \cdot 5 \]
    6. Simplified82.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-55} \lor \neg \left(x \leq 6.5 \cdot 10^{-146}\right):\\ \;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(y + t\right)\\ \end{array} \]

Alternative 10: 87.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{-53} \lor \neg \left(x \leq 2.95 \cdot 10^{-121}\right):\\ \;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(y + z \cdot 2\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -5e-53) (not (<= x 2.95e-121)))
   (* x (+ t (+ (* y 2.0) (* z 2.0))))
   (+ (* y 5.0) (* x (+ y (* z 2.0))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -5e-53) || !(x <= 2.95e-121)) {
		tmp = x * (t + ((y * 2.0) + (z * 2.0)));
	} else {
		tmp = (y * 5.0) + (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) :: tmp
    if ((x <= (-5d-53)) .or. (.not. (x <= 2.95d-121))) then
        tmp = x * (t + ((y * 2.0d0) + (z * 2.0d0)))
    else
        tmp = (y * 5.0d0) + (x * (y + (z * 2.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -5e-53) || !(x <= 2.95e-121)) {
		tmp = x * (t + ((y * 2.0) + (z * 2.0)));
	} else {
		tmp = (y * 5.0) + (x * (y + (z * 2.0)));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -5e-53) or not (x <= 2.95e-121):
		tmp = x * (t + ((y * 2.0) + (z * 2.0)))
	else:
		tmp = (y * 5.0) + (x * (y + (z * 2.0)))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -5e-53) || !(x <= 2.95e-121))
		tmp = Float64(x * Float64(t + Float64(Float64(y * 2.0) + Float64(z * 2.0))));
	else
		tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(y + Float64(z * 2.0))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -5e-53) || ~((x <= 2.95e-121)))
		tmp = x * (t + ((y * 2.0) + (z * 2.0)));
	else
		tmp = (y * 5.0) + (x * (y + (z * 2.0)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5e-53], N[Not[LessEqual[x, 2.95e-121]], $MachinePrecision]], N[(x * N[(t + N[(N[(y * 2.0), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(y + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-53} \lor \neg \left(x \leq 2.95 \cdot 10^{-121}\right):\\
\;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5e-53 or 2.94999999999999998e-121 < 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. Taylor expanded in x around inf 96.0%

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

    if -5e-53 < x < 2.94999999999999998e-121

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{-53} \lor \neg \left(x \leq 2.95 \cdot 10^{-121}\right):\\ \;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(y + z \cdot 2\right)\\ \end{array} \]

Alternative 11: 99.8% accurate, 1.0× speedup?

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

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

    \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
  2. Final simplification99.9%

    \[\leadsto x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) + y \cdot 5 \]

Alternative 12: 43.0% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;t \leq 1.12 \cdot 10^{-223}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;t \leq 8.5 \cdot 10^{-188}:\\
\;\;\;\;y \cdot x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.15e101 or 1.7e-33 < 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. Taylor expanded in t around inf 68.3%

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

    if -2.15e101 < t < 1.1199999999999999e-223 or 8.5000000000000004e-188 < t < 1.7e-33

    1. Initial program 99.9%

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

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

    if 1.1199999999999999e-223 < t < 8.5000000000000004e-188

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(5 + x\right)} \]
    5. Taylor expanded in x around inf 59.1%

      \[\leadsto \color{blue}{x \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification51.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.15 \cdot 10^{+101}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{-223}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-188}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-33}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]

Alternative 13: 77.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+57} \lor \neg \left(y \leq 6.3 \cdot 10^{-15}\right):\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -2.3e+57) (not (<= y 6.3e-15)))
   (* y (+ 5.0 (* x 2.0)))
   (* x (+ t (* z 2.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -2.3e+57) || !(y <= 6.3e-15)) {
		tmp = y * (5.0 + (x * 2.0));
	} else {
		tmp = x * (t + (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) :: tmp
    if ((y <= (-2.3d+57)) .or. (.not. (y <= 6.3d-15))) then
        tmp = y * (5.0d0 + (x * 2.0d0))
    else
        tmp = x * (t + (z * 2.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -2.3e+57) || !(y <= 6.3e-15)) {
		tmp = y * (5.0 + (x * 2.0));
	} else {
		tmp = x * (t + (z * 2.0));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -2.3e+57) or not (y <= 6.3e-15):
		tmp = y * (5.0 + (x * 2.0))
	else:
		tmp = x * (t + (z * 2.0))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -2.3e+57) || !(y <= 6.3e-15))
		tmp = Float64(y * Float64(5.0 + Float64(x * 2.0)));
	else
		tmp = Float64(x * Float64(t + Float64(z * 2.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -2.3e+57) || ~((y <= 6.3e-15)))
		tmp = y * (5.0 + (x * 2.0));
	else
		tmp = x * (t + (z * 2.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.3e+57], N[Not[LessEqual[y, 6.3e-15]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+57} \lor \neg \left(y \leq 6.3 \cdot 10^{-15}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.2999999999999999e57 or 6.29999999999999982e-15 < 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. Taylor expanded in y around inf 75.0%

      \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
    3. Simplified75.0%

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

    if -2.2999999999999999e57 < y < 6.29999999999999982e-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. Taylor expanded in y around 0 81.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+57} \lor \neg \left(y \leq 6.3 \cdot 10^{-15}\right):\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \end{array} \]

Alternative 14: 77.9% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+54}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(y \cdot x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.79999999999999997e54

    1. Initial program 99.9%

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

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

    if -4.79999999999999997e54 < y < 1.09999999999999998e-13

    1. Initial program 99.9%

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

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

    if 1.09999999999999998e-13 < 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. Taylor expanded in y around inf 71.8%

      \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
    3. Simplified71.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+54}:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-13}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \end{array} \]

Alternative 15: 43.8% accurate, 2.1× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.3000000000000001e100 or 1.80000000000000017e-33 < 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. Taylor expanded in t around inf 68.3%

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

    if -1.3000000000000001e100 < t < 1.80000000000000017e-33

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{+100}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-33}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]

Alternative 16: 31.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. Taylor expanded in x around 0 28.0%

    \[\leadsto \color{blue}{5 \cdot y} \]
  3. Final simplification28.0%

    \[\leadsto y \cdot 5 \]

Reproduce

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