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

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

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

    \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
  2. Step-by-step derivation
    1. fma-define99.9%

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

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

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

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

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

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

Alternative 2: 42.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -2.3 \cdot 10^{-228}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;z \leq -3.95 \cdot 10^{-289}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-295}:\\
\;\;\;\;x \cdot t\\

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-58}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{-17}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;z \leq 2.8 \cdot 10^{+103}:\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.60000000000000009e141 or 2.80000000000000008e103 < z

    1. Initial program 100.0%

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

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

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

    if -1.60000000000000009e141 < z < -2.2999999999999999e-228 or -3.9499999999999999e-289 < z < 3.6000000000000001e-295 or 3.6000000000000003e-120 < z < 2.60000000000000007e-58 or 2.30000000000000009e-17 < z < 2.80000000000000008e103

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{t \cdot x} \]
    4. Simplified54.6%

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

    if -2.2999999999999999e-228 < z < -3.9499999999999999e-289 or 2.60000000000000007e-58 < z < 2.30000000000000009e-17

    1. Initial program 100.0%

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

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

    if 3.6000000000000001e-295 < z < 3.6000000000000003e-120

    1. Initial program 99.8%

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

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

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

        \[\leadsto x \cdot \left(t + 2 \cdot z\right) + \color{blue}{\left(x \cdot y\right) \cdot 2} \]
      2. *-commutative70.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot y} \]
      2. *-commutative49.2%

        \[\leadsto \color{blue}{y \cdot \left(2 \cdot x\right)} \]
      3. *-commutative49.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+141}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-228}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;z \leq -3.95 \cdot 10^{-289}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-295}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-120}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-58}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-17}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+103}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 46.6% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \leq -2.3 \cdot 10^{+57}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;x \leq -1250000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -3.9 \cdot 10^{-87}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;x \leq 3.8 \cdot 10^{-92}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;x \leq 6.4 \cdot 10^{+128} \lor \neg \left(x \leq 1.28 \cdot 10^{+181}\right):\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.6000000000000001e202 or -2.2999999999999999e57 < x < -1.25e12 or 6.39999999999999971e128 < x < 1.27999999999999997e181

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(2 \cdot x\right)} \]
      3. *-commutative58.1%

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

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

    if -7.6000000000000001e202 < x < -2.2999999999999999e57 or -1.25e12 < x < -3.8999999999999998e-87 or 3.8000000000000001e-92 < x < 6.39999999999999971e128 or 1.27999999999999997e181 < x

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{t \cdot x} \]
    4. Simplified51.0%

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

    if -3.8999999999999998e-87 < x < 3.8000000000000001e-92

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.6 \cdot 10^{+202}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{+57}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -1250000000000:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq -3.9 \cdot 10^{-87}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-92}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{+128} \lor \neg \left(x \leq 1.28 \cdot 10^{+181}\right):\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 66.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + 2 \cdot z\right)\\ t_2 := x \cdot \left(t + 2 \cdot y\right)\\ \mathbf{if}\;x \leq -2900000000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-87}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{-141}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+147} \lor \neg \left(x \leq 6 \cdot 10^{+255}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* 2.0 z)))) (t_2 (* x (+ t (* 2.0 y)))))
   (if (<= x -2900000000000.0)
     t_2
     (if (<= x -1.3e-87)
       t_1
       (if (<= x 1.22e-141)
         (* y 5.0)
         (if (or (<= x 2.2e+147) (not (<= x 6e+255))) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (2.0 * z));
	double t_2 = x * (t + (2.0 * y));
	double tmp;
	if (x <= -2900000000000.0) {
		tmp = t_2;
	} else if (x <= -1.3e-87) {
		tmp = t_1;
	} else if (x <= 1.22e-141) {
		tmp = y * 5.0;
	} else if ((x <= 2.2e+147) || !(x <= 6e+255)) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (t + (2.0d0 * z))
    t_2 = x * (t + (2.0d0 * y))
    if (x <= (-2900000000000.0d0)) then
        tmp = t_2
    else if (x <= (-1.3d-87)) then
        tmp = t_1
    else if (x <= 1.22d-141) then
        tmp = y * 5.0d0
    else if ((x <= 2.2d+147) .or. (.not. (x <= 6d+255))) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (2.0 * z));
	double t_2 = x * (t + (2.0 * y));
	double tmp;
	if (x <= -2900000000000.0) {
		tmp = t_2;
	} else if (x <= -1.3e-87) {
		tmp = t_1;
	} else if (x <= 1.22e-141) {
		tmp = y * 5.0;
	} else if ((x <= 2.2e+147) || !(x <= 6e+255)) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (2.0 * z))
	t_2 = x * (t + (2.0 * y))
	tmp = 0
	if x <= -2900000000000.0:
		tmp = t_2
	elif x <= -1.3e-87:
		tmp = t_1
	elif x <= 1.22e-141:
		tmp = y * 5.0
	elif (x <= 2.2e+147) or not (x <= 6e+255):
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(2.0 * z)))
	t_2 = Float64(x * Float64(t + Float64(2.0 * y)))
	tmp = 0.0
	if (x <= -2900000000000.0)
		tmp = t_2;
	elseif (x <= -1.3e-87)
		tmp = t_1;
	elseif (x <= 1.22e-141)
		tmp = Float64(y * 5.0);
	elseif ((x <= 2.2e+147) || !(x <= 6e+255))
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (2.0 * z));
	t_2 = x * (t + (2.0 * y));
	tmp = 0.0;
	if (x <= -2900000000000.0)
		tmp = t_2;
	elseif (x <= -1.3e-87)
		tmp = t_1;
	elseif (x <= 1.22e-141)
		tmp = y * 5.0;
	elseif ((x <= 2.2e+147) || ~((x <= 6e+255)))
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2900000000000.0], t$95$2, If[LessEqual[x, -1.3e-87], t$95$1, If[LessEqual[x, 1.22e-141], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 2.2e+147], N[Not[LessEqual[x, 6e+255]], $MachinePrecision]], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.3 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.22 \cdot 10^{-141}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;x \leq 2.2 \cdot 10^{+147} \lor \neg \left(x \leq 6 \cdot 10^{+255}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.9e12 or 2.2000000000000002e147 < x < 6.00000000000000035e255

    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. fma-define100.0%

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

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

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

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

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

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

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

    if -2.9e12 < x < -1.30000000000000001e-87 or 1.22e-141 < x < 2.2000000000000002e147 or 6.00000000000000035e255 < x

    1. Initial program 100.0%

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

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

    if -1.30000000000000001e-87 < x < 1.22e-141

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2900000000000:\\ \;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-87}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{-141}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+147} \lor \neg \left(x \leq 6 \cdot 10^{+255}\right):\\ \;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 77.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -1.7 \cdot 10^{+89}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{+33}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\ \mathbf{elif}\;y \leq -400000000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-19}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
   (if (<= y -1.7e+89)
     t_1
     (if (<= y -4.6e+33)
       (* x (+ t (* 2.0 y)))
       (if (or (<= y -400000000000.0) (not (<= y 1.95e-19)))
         t_1
         (* x (+ t (* 2.0 z))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -1.7e+89) {
		tmp = t_1;
	} else if (y <= -4.6e+33) {
		tmp = x * (t + (2.0 * y));
	} else if ((y <= -400000000000.0) || !(y <= 1.95e-19)) {
		tmp = t_1;
	} else {
		tmp = x * (t + (2.0 * 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) :: t_1
    real(8) :: tmp
    t_1 = y * (5.0d0 + (x * 2.0d0))
    if (y <= (-1.7d+89)) then
        tmp = t_1
    else if (y <= (-4.6d+33)) then
        tmp = x * (t + (2.0d0 * y))
    else if ((y <= (-400000000000.0d0)) .or. (.not. (y <= 1.95d-19))) then
        tmp = t_1
    else
        tmp = x * (t + (2.0d0 * z))
    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 <= -1.7e+89) {
		tmp = t_1;
	} else if (y <= -4.6e+33) {
		tmp = x * (t + (2.0 * y));
	} else if ((y <= -400000000000.0) || !(y <= 1.95e-19)) {
		tmp = t_1;
	} else {
		tmp = x * (t + (2.0 * z));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (5.0 + (x * 2.0))
	tmp = 0
	if y <= -1.7e+89:
		tmp = t_1
	elif y <= -4.6e+33:
		tmp = x * (t + (2.0 * y))
	elif (y <= -400000000000.0) or not (y <= 1.95e-19):
		tmp = t_1
	else:
		tmp = x * (t + (2.0 * z))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0)))
	tmp = 0.0
	if (y <= -1.7e+89)
		tmp = t_1;
	elseif (y <= -4.6e+33)
		tmp = Float64(x * Float64(t + Float64(2.0 * y)));
	elseif ((y <= -400000000000.0) || !(y <= 1.95e-19))
		tmp = t_1;
	else
		tmp = Float64(x * Float64(t + Float64(2.0 * z)));
	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 <= -1.7e+89)
		tmp = t_1;
	elseif (y <= -4.6e+33)
		tmp = x * (t + (2.0 * y));
	elseif ((y <= -400000000000.0) || ~((y <= 1.95e-19)))
		tmp = t_1;
	else
		tmp = x * (t + (2.0 * z));
	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, -1.7e+89], t$95$1, If[LessEqual[y, -4.6e+33], N[(x * N[(t + N[(2.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -400000000000.0], N[Not[LessEqual[y, 1.95e-19]], $MachinePrecision]], t$95$1, N[(x * N[(t + N[(2.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -400000000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-19}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.7000000000000001e89 or -4.60000000000000021e33 < y < -4e11 or 1.94999999999999998e-19 < y

    1. Initial program 99.9%

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

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

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

    if -1.7000000000000001e89 < y < -4.60000000000000021e33

    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. fma-define100.0%

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

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

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

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

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

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

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

    if -4e11 < y < 1.94999999999999998e-19

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+89}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{+33}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\ \mathbf{elif}\;y \leq -400000000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-19}\right):\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 57.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -9.5 \cdot 10^{-229}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -7.8 \cdot 10^{-286}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;z \leq 4.65 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.95000000000000014e141 or 4.6500000000000001e114 < z

    1. Initial program 100.0%

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

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

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

    if -2.95000000000000014e141 < z < -9.4999999999999997e-229 or -7.7999999999999999e-286 < z < 4.6500000000000001e114

    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. fma-define99.9%

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

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

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

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

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

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

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

    if -9.4999999999999997e-229 < z < -7.7999999999999999e-286

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.95 \cdot 10^{+141}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-229}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-286}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq 4.65 \cdot 10^{+114}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 99.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.2999999999999999e-16 or 1.09999999999999995e-10 < x

    1. Initial program 100.0%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

    if -4.2999999999999999e-16 < x < 1.09999999999999995e-10

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{-16} \lor \neg \left(x \leq 1.1 \cdot 10^{-10}\right):\\ \;\;\;\;x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot z\right) + y \cdot 5\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 87.7% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.29999999999999996e-34 or 7.50000000000000066e-117 < 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. fma-define100.0%

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

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

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

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

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

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

    if -7.29999999999999996e-34 < x < 7.0000000000000002e-280

    1. Initial program 99.9%

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

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

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

    if 7.0000000000000002e-280 < x < 7.50000000000000066e-117

    1. Initial program 99.9%

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

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

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

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

Alternative 9: 77.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -4 \cdot 10^{+147}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-46}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-18}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot z\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 -4e+147)
     t_1
     (if (<= y -1.4e-46)
       (+ (* y 5.0) (* x t))
       (if (<= y 1.6e-18) (* x (+ t (* 2.0 z))) 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 <= -4e+147) {
		tmp = t_1;
	} else if (y <= -1.4e-46) {
		tmp = (y * 5.0) + (x * t);
	} else if (y <= 1.6e-18) {
		tmp = x * (t + (2.0 * z));
	} 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 <= (-4d+147)) then
        tmp = t_1
    else if (y <= (-1.4d-46)) then
        tmp = (y * 5.0d0) + (x * t)
    else if (y <= 1.6d-18) then
        tmp = x * (t + (2.0d0 * z))
    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 <= -4e+147) {
		tmp = t_1;
	} else if (y <= -1.4e-46) {
		tmp = (y * 5.0) + (x * t);
	} else if (y <= 1.6e-18) {
		tmp = x * (t + (2.0 * z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (5.0 + (x * 2.0))
	tmp = 0
	if y <= -4e+147:
		tmp = t_1
	elif y <= -1.4e-46:
		tmp = (y * 5.0) + (x * t)
	elif y <= 1.6e-18:
		tmp = x * (t + (2.0 * z))
	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 <= -4e+147)
		tmp = t_1;
	elseif (y <= -1.4e-46)
		tmp = Float64(Float64(y * 5.0) + Float64(x * t));
	elseif (y <= 1.6e-18)
		tmp = Float64(x * Float64(t + Float64(2.0 * z)));
	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 <= -4e+147)
		tmp = t_1;
	elseif (y <= -1.4e-46)
		tmp = (y * 5.0) + (x * t);
	elseif (y <= 1.6e-18)
		tmp = x * (t + (2.0 * z));
	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, -4e+147], t$95$1, If[LessEqual[y, -1.4e-46], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-18], N[(x * N[(t + N[(2.0 * z), $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 -4 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.9999999999999999e147 or 1.6e-18 < y

    1. Initial program 99.9%

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

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

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

    if -3.9999999999999999e147 < y < -1.3999999999999999e-46

    1. Initial program 99.9%

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

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

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

    if -1.3999999999999999e-46 < y < 1.6e-18

    1. Initial program 100.0%

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

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

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

Alternative 10: 99.1% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.5e11 or 2.5 < x

    1. Initial program 100.0%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

    if -6.5e11 < x < 2.5

    1. Initial program 99.9%

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

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

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

Alternative 11: 88.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{-34} \lor \neg \left(x \leq 3.8 \cdot 10^{-92}\right):\\
\;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.89999999999999991e-34 or 3.8000000000000001e-92 < 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. fma-define100.0%

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

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

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

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

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

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

    if -3.89999999999999991e-34 < x < 3.8000000000000001e-92

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.9 \cdot 10^{-34} \lor \neg \left(x \leq 3.8 \cdot 10^{-92}\right):\\ \;\;\;\;x \cdot \left(2 \cdot \left(y + z\right) + t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 97.0% accurate, 1.0× speedup?

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

\\
x \cdot \left(t + 2 \cdot z\right) + y \cdot \left(5 + x \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. Add Preprocessing
  3. Taylor expanded in y around 0 96.8%

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

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

Alternative 13: 99.9% 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. Add Preprocessing
  3. Final simplification99.9%

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

Alternative 14: 46.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-87} \lor \neg \left(x \leq 1.9 \cdot 10^{-93}\right):\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.6000000000000003e-87 or 1.8999999999999999e-93 < x

    1. Initial program 100.0%

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

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

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

    if -4.6000000000000003e-87 < x < 1.8999999999999999e-93

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{-87} \lor \neg \left(x \leq 1.9 \cdot 10^{-93}\right):\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 30.7% 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. Add Preprocessing
  3. Taylor expanded in x around 0 27.7%

    \[\leadsto \color{blue}{5 \cdot y} \]
  4. Final simplification27.7%

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

Reproduce

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