Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H

Percentage Accurate: 96.2% → 98.1%
Time: 10.1s
Alternatives: 11
Speedup: 0.4×

Specification

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

\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\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 11 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: 96.2% accurate, 1.0× speedup?

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

\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}

Alternative 1: 98.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 2 \cdot 10^{+301}:\\ \;\;\;\;\left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right) + \frac{y}{z \cdot -3}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(t \cdot \frac{1}{y} - y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) 2e+301)
   (+ (+ x (/ t (* z (* y 3.0)))) (/ y (* z -3.0)))
   (+ x (* (/ 0.3333333333333333 z) (- (* t (/ 1.0 y)) y)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+301) {
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
	} else {
		tmp = x + ((0.3333333333333333 / z) * ((t * (1.0 / y)) - y));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (((x - (y / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))) <= 2d+301) then
        tmp = (x + (t / (z * (y * 3.0d0)))) + (y / (z * (-3.0d0)))
    else
        tmp = x + ((0.3333333333333333d0 / z) * ((t * (1.0d0 / y)) - y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+301) {
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
	} else {
		tmp = x + ((0.3333333333333333 / z) * ((t * (1.0 / y)) - y));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+301:
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0))
	else:
		tmp = x + ((0.3333333333333333 / z) * ((t * (1.0 / y)) - y))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) <= 2e+301)
		tmp = Float64(Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))) + Float64(y / Float64(z * -3.0)));
	else
		tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t * Float64(1.0 / y)) - y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+301)
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
	else
		tmp = x + ((0.3333333333333333 / z) * ((t * (1.0 / y)) - y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+301], N[(N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t * N[(1.0 / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right) + \frac{y}{z \cdot -3}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(t \cdot \frac{1}{y} - y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) < 2.00000000000000011e301

    1. Initial program 98.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. +-commutative98.3%

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

        \[\leadsto \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + x\right) - \frac{y}{z \cdot 3}} \]
      3. sub-neg98.3%

        \[\leadsto \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + x\right) + \left(-\frac{y}{z \cdot 3}\right)} \]
      4. associate-*l*98.3%

        \[\leadsto \left(\frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} + x\right) + \left(-\frac{y}{z \cdot 3}\right) \]
      5. *-commutative98.3%

        \[\leadsto \left(\frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} + x\right) + \left(-\frac{y}{z \cdot 3}\right) \]
      6. distribute-frac-neg298.3%

        \[\leadsto \left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \color{blue}{\frac{y}{-z \cdot 3}} \]
      7. distribute-rgt-neg-in98.3%

        \[\leadsto \left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{\color{blue}{z \cdot \left(-3\right)}} \]
      8. metadata-eval98.3%

        \[\leadsto \left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot \color{blue}{-3}} \]
    3. Simplified98.3%

      \[\leadsto \color{blue}{\left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot -3}} \]
    4. Add Preprocessing

    if 2.00000000000000011e301 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y)))

    1. Initial program 77.2%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg77.2%

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg77.2%

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

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in77.2%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg77.2%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg77.2%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-177.2%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac90.8%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg90.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-190.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative90.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*90.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative90.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-1}{z \cdot 3} \cdot y}\right)\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-inv99.9%

        \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    6. Applied egg-rr99.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq 2 \cdot 10^{+301}:\\ \;\;\;\;\left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right) + \frac{y}{z \cdot -3}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(t \cdot \frac{1}{y} - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 62.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{+39}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-19}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2.25e+39)
   (/ (* y -0.3333333333333333) z)
   (if (<= y -8.5e-104)
     x
     (if (<= y 3.9e-19)
       (* (/ t z) (/ 0.3333333333333333 y))
       (* (/ y z) -0.3333333333333333)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.25e+39) {
		tmp = (y * -0.3333333333333333) / z;
	} else if (y <= -8.5e-104) {
		tmp = x;
	} else if (y <= 3.9e-19) {
		tmp = (t / z) * (0.3333333333333333 / y);
	} else {
		tmp = (y / z) * -0.3333333333333333;
	}
	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.25d+39)) then
        tmp = (y * (-0.3333333333333333d0)) / z
    else if (y <= (-8.5d-104)) then
        tmp = x
    else if (y <= 3.9d-19) then
        tmp = (t / z) * (0.3333333333333333d0 / y)
    else
        tmp = (y / z) * (-0.3333333333333333d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.25e+39) {
		tmp = (y * -0.3333333333333333) / z;
	} else if (y <= -8.5e-104) {
		tmp = x;
	} else if (y <= 3.9e-19) {
		tmp = (t / z) * (0.3333333333333333 / y);
	} else {
		tmp = (y / z) * -0.3333333333333333;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -2.25e+39:
		tmp = (y * -0.3333333333333333) / z
	elif y <= -8.5e-104:
		tmp = x
	elif y <= 3.9e-19:
		tmp = (t / z) * (0.3333333333333333 / y)
	else:
		tmp = (y / z) * -0.3333333333333333
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.25e+39)
		tmp = Float64(Float64(y * -0.3333333333333333) / z);
	elseif (y <= -8.5e-104)
		tmp = x;
	elseif (y <= 3.9e-19)
		tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y));
	else
		tmp = Float64(Float64(y / z) * -0.3333333333333333);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -2.25e+39)
		tmp = (y * -0.3333333333333333) / z;
	elseif (y <= -8.5e-104)
		tmp = x;
	elseif (y <= 3.9e-19)
		tmp = (t / z) * (0.3333333333333333 / y);
	else
		tmp = (y / z) * -0.3333333333333333;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.25e+39], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, -8.5e-104], x, If[LessEqual[y, 3.9e-19], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{+39}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\

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

\mathbf{elif}\;y \leq 3.9 \cdot 10^{-19}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.24999999999999998e39

    1. Initial program 96.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg96.0%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. distribute-frac-neg96.0%

        \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      4. neg-mul-196.0%

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative96.0%

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac96.0%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define96.0%

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

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*96.0%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative96.0%

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - 0.3333333333333333 \cdot \frac{1}{z}\right)} \]
    6. Taylor expanded in x around 0 72.3%

      \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
    7. Step-by-step derivation
      1. associate-*r/72.5%

        \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    8. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]

    if -2.24999999999999998e39 < y < -8.50000000000000007e-104

    1. Initial program 97.4%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg97.4%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. distribute-frac-neg97.4%

        \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      4. neg-mul-197.4%

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative97.4%

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac97.4%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define97.4%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. metadata-eval97.4%

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*97.4%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative97.4%

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

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

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

    if -8.50000000000000007e-104 < y < 3.89999999999999995e-19

    1. Initial program 91.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg91.0%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. +-commutative91.0%

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg91.0%

        \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      5. distribute-frac-neg91.0%

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in91.0%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg91.0%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg91.0%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-191.0%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac92.0%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg92.0%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-192.0%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative92.0%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*92.0%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative92.0%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-1}{z \cdot 3} \cdot y}\right)\right) \]
    3. Simplified92.0%

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-inv92.0%

        \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    6. Applied egg-rr92.0%

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    7. Taylor expanded in t around -inf 84.8%

      \[\leadsto x + \color{blue}{-1 \cdot \left(t \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*84.8%

        \[\leadsto x + \color{blue}{\left(-1 \cdot t\right) \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)} \]
      2. neg-mul-184.8%

        \[\leadsto x + \color{blue}{\left(-t\right)} \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right) \]
      3. distribute-lft-out--84.8%

        \[\leadsto x + \left(-t\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)\right)} \]
      4. associate-*r*84.7%

        \[\leadsto x + \color{blue}{\left(\left(-t\right) \cdot 0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
      5. distribute-lft-neg-in84.7%

        \[\leadsto x + \color{blue}{\left(-t \cdot 0.3333333333333333\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      6. distribute-rgt-neg-in84.7%

        \[\leadsto x + \color{blue}{\left(t \cdot \left(-0.3333333333333333\right)\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      7. metadata-eval84.7%

        \[\leadsto x + \left(t \cdot \color{blue}{-0.3333333333333333}\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
    9. Simplified84.7%

      \[\leadsto x + \color{blue}{\left(t \cdot -0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
    10. Taylor expanded in t around inf 63.8%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z}} \]
    11. Step-by-step derivation
      1. associate-*r/63.7%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} \]
      2. *-commutative63.7%

        \[\leadsto \frac{0.3333333333333333 \cdot t}{\color{blue}{z \cdot y}} \]
      3. *-commutative63.7%

        \[\leadsto \frac{\color{blue}{t \cdot 0.3333333333333333}}{z \cdot y} \]
      4. times-frac66.8%

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    12. Simplified66.8%

      \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]

    if 3.89999999999999995e-19 < y

    1. Initial program 94.7%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg94.7%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. +-commutative94.7%

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg94.7%

        \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      5. distribute-frac-neg94.7%

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in94.7%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg94.7%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg94.7%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-194.7%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac94.7%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg94.7%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-194.7%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative94.7%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-1}{z \cdot 3} \cdot y}\right)\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-inv99.7%

        \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    6. Applied egg-rr99.7%

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    7. Taylor expanded in t around -inf 86.7%

      \[\leadsto x + \color{blue}{-1 \cdot \left(t \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*86.7%

        \[\leadsto x + \color{blue}{\left(-1 \cdot t\right) \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)} \]
      2. neg-mul-186.7%

        \[\leadsto x + \color{blue}{\left(-t\right)} \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right) \]
      3. distribute-lft-out--86.7%

        \[\leadsto x + \left(-t\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)\right)} \]
      4. associate-*r*86.7%

        \[\leadsto x + \color{blue}{\left(\left(-t\right) \cdot 0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
      5. distribute-lft-neg-in86.7%

        \[\leadsto x + \color{blue}{\left(-t \cdot 0.3333333333333333\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      6. distribute-rgt-neg-in86.7%

        \[\leadsto x + \color{blue}{\left(t \cdot \left(-0.3333333333333333\right)\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      7. metadata-eval86.7%

        \[\leadsto x + \left(t \cdot \color{blue}{-0.3333333333333333}\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
    9. Simplified86.7%

      \[\leadsto x + \color{blue}{\left(t \cdot -0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
    10. Taylor expanded in y around inf 59.9%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification65.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.25 \cdot 10^{+39}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-19}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 61.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.08 \cdot 10^{+39}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-18}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.08e+39)
   (/ (* y -0.3333333333333333) z)
   (if (<= y -1.05e-104)
     x
     (if (<= y 1.4e-18)
       (* 0.3333333333333333 (/ t (* y z)))
       (* (/ y z) -0.3333333333333333)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.08e+39) {
		tmp = (y * -0.3333333333333333) / z;
	} else if (y <= -1.05e-104) {
		tmp = x;
	} else if (y <= 1.4e-18) {
		tmp = 0.3333333333333333 * (t / (y * z));
	} else {
		tmp = (y / z) * -0.3333333333333333;
	}
	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 <= (-1.08d+39)) then
        tmp = (y * (-0.3333333333333333d0)) / z
    else if (y <= (-1.05d-104)) then
        tmp = x
    else if (y <= 1.4d-18) then
        tmp = 0.3333333333333333d0 * (t / (y * z))
    else
        tmp = (y / z) * (-0.3333333333333333d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.08e+39) {
		tmp = (y * -0.3333333333333333) / z;
	} else if (y <= -1.05e-104) {
		tmp = x;
	} else if (y <= 1.4e-18) {
		tmp = 0.3333333333333333 * (t / (y * z));
	} else {
		tmp = (y / z) * -0.3333333333333333;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1.08e+39:
		tmp = (y * -0.3333333333333333) / z
	elif y <= -1.05e-104:
		tmp = x
	elif y <= 1.4e-18:
		tmp = 0.3333333333333333 * (t / (y * z))
	else:
		tmp = (y / z) * -0.3333333333333333
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.08e+39)
		tmp = Float64(Float64(y * -0.3333333333333333) / z);
	elseif (y <= -1.05e-104)
		tmp = x;
	elseif (y <= 1.4e-18)
		tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z)));
	else
		tmp = Float64(Float64(y / z) * -0.3333333333333333);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1.08e+39)
		tmp = (y * -0.3333333333333333) / z;
	elseif (y <= -1.05e-104)
		tmp = x;
	elseif (y <= 1.4e-18)
		tmp = 0.3333333333333333 * (t / (y * z));
	else
		tmp = (y / z) * -0.3333333333333333;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.08e+39], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, -1.05e-104], x, If[LessEqual[y, 1.4e-18], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{+39}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq -1.05 \cdot 10^{-104}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{-18}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.07999999999999998e39

    1. Initial program 96.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg96.0%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. distribute-frac-neg96.0%

        \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      4. neg-mul-196.0%

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative96.0%

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac96.0%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define96.0%

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

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*96.0%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative96.0%

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - 0.3333333333333333 \cdot \frac{1}{z}\right)} \]
    6. Taylor expanded in x around 0 72.3%

      \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
    7. Step-by-step derivation
      1. associate-*r/72.5%

        \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    8. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]

    if -1.07999999999999998e39 < y < -1.04999999999999999e-104

    1. Initial program 97.4%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg97.4%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. distribute-frac-neg97.4%

        \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      4. neg-mul-197.4%

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative97.4%

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac97.4%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define97.4%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. metadata-eval97.4%

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*97.4%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative97.4%

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

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

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

    if -1.04999999999999999e-104 < y < 1.40000000000000006e-18

    1. Initial program 91.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg91.0%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. +-commutative91.0%

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg91.0%

        \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      5. distribute-frac-neg91.0%

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in91.0%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg91.0%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg91.0%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-191.0%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac92.0%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg92.0%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-192.0%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative92.0%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*92.0%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative92.0%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-1}{z \cdot 3} \cdot y}\right)\right) \]
    3. Simplified92.0%

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-inv92.0%

        \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    6. Applied egg-rr92.0%

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    7. Taylor expanded in t around -inf 84.8%

      \[\leadsto x + \color{blue}{-1 \cdot \left(t \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*84.8%

        \[\leadsto x + \color{blue}{\left(-1 \cdot t\right) \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)} \]
      2. neg-mul-184.8%

        \[\leadsto x + \color{blue}{\left(-t\right)} \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right) \]
      3. distribute-lft-out--84.8%

        \[\leadsto x + \left(-t\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)\right)} \]
      4. associate-*r*84.7%

        \[\leadsto x + \color{blue}{\left(\left(-t\right) \cdot 0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
      5. distribute-lft-neg-in84.7%

        \[\leadsto x + \color{blue}{\left(-t \cdot 0.3333333333333333\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      6. distribute-rgt-neg-in84.7%

        \[\leadsto x + \color{blue}{\left(t \cdot \left(-0.3333333333333333\right)\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      7. metadata-eval84.7%

        \[\leadsto x + \left(t \cdot \color{blue}{-0.3333333333333333}\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
    9. Simplified84.7%

      \[\leadsto x + \color{blue}{\left(t \cdot -0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
    10. Taylor expanded in t around inf 63.8%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z}} \]

    if 1.40000000000000006e-18 < y

    1. Initial program 94.7%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg94.7%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. +-commutative94.7%

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg94.7%

        \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      5. distribute-frac-neg94.7%

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in94.7%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg94.7%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg94.7%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-194.7%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac94.7%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg94.7%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-194.7%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative94.7%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-1}{z \cdot 3} \cdot y}\right)\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-inv99.7%

        \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    6. Applied egg-rr99.7%

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    7. Taylor expanded in t around -inf 86.7%

      \[\leadsto x + \color{blue}{-1 \cdot \left(t \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*86.7%

        \[\leadsto x + \color{blue}{\left(-1 \cdot t\right) \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)} \]
      2. neg-mul-186.7%

        \[\leadsto x + \color{blue}{\left(-t\right)} \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right) \]
      3. distribute-lft-out--86.7%

        \[\leadsto x + \left(-t\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)\right)} \]
      4. associate-*r*86.7%

        \[\leadsto x + \color{blue}{\left(\left(-t\right) \cdot 0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
      5. distribute-lft-neg-in86.7%

        \[\leadsto x + \color{blue}{\left(-t \cdot 0.3333333333333333\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      6. distribute-rgt-neg-in86.7%

        \[\leadsto x + \color{blue}{\left(t \cdot \left(-0.3333333333333333\right)\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      7. metadata-eval86.7%

        \[\leadsto x + \left(t \cdot \color{blue}{-0.3333333333333333}\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
    9. Simplified86.7%

      \[\leadsto x + \color{blue}{\left(t \cdot -0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
    10. Taylor expanded in y around inf 59.9%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification64.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.08 \cdot 10^{+39}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-18}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 91.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+66} \lor \neg \left(y \leq 1.3 \cdot 10^{+31}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z}}{y \cdot 3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.6000000000000004e66 or 1.3e31 < y

    1. Initial program 94.4%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 96.6%

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]

    if -7.6000000000000004e66 < y < 1.3e31

    1. Initial program 93.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg93.3%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. +-commutative93.3%

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg93.3%

        \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      5. distribute-frac-neg93.3%

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in93.3%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg93.3%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg93.3%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-193.3%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac94.6%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-194.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative94.6%

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

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

      \[\leadsto x + \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z}} \]
    6. Step-by-step derivation
      1. *-commutative87.7%

        \[\leadsto x + \color{blue}{\frac{t}{y \cdot z} \cdot 0.3333333333333333} \]
      2. metadata-eval87.7%

        \[\leadsto x + \frac{t}{y \cdot z} \cdot \color{blue}{\frac{1}{3}} \]
      3. times-frac87.7%

        \[\leadsto x + \color{blue}{\frac{t \cdot 1}{\left(y \cdot z\right) \cdot 3}} \]
      4. *-rgt-identity87.7%

        \[\leadsto x + \frac{\color{blue}{t}}{\left(y \cdot z\right) \cdot 3} \]
      5. *-commutative87.7%

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

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

        \[\leadsto x + \color{blue}{\frac{\frac{t}{z}}{y \cdot 3}} \]
    7. Simplified92.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{+66} \lor \neg \left(y \leq 1.3 \cdot 10^{+31}\right):\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{z}}{y \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 88.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+67} \lor \neg \left(y \leq 5.8 \cdot 10^{+32}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \frac{t}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.6500000000000001e67 or 5.80000000000000006e32 < y

    1. Initial program 94.4%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 96.6%

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]

    if -1.6500000000000001e67 < y < 5.80000000000000006e32

    1. Initial program 93.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg93.3%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. +-commutative93.3%

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg93.3%

        \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      5. distribute-frac-neg93.3%

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in93.3%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg93.3%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg93.3%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-193.3%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac94.6%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-194.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative94.6%

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

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

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

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

Alternative 6: 89.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+66} \lor \neg \left(y \leq 1.55 \cdot 10^{+33}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.6000000000000004e66 or 1.55e33 < y

    1. Initial program 94.4%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 96.6%

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]

    if -7.6000000000000004e66 < y < 1.55e33

    1. Initial program 93.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg93.3%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. +-commutative93.3%

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg93.3%

        \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      5. distribute-frac-neg93.3%

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in93.3%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg93.3%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg93.3%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-193.3%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac94.6%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-194.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*94.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative94.6%

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

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

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

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

Alternative 7: 77.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{-103} \lor \neg \left(y \leq 2.25 \cdot 10^{-38}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.89999999999999953e-103 or 2.25000000000000004e-38 < y

    1. Initial program 95.9%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 84.9%

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]

    if -4.89999999999999953e-103 < y < 2.25000000000000004e-38

    1. Initial program 90.7%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg90.7%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. +-commutative90.7%

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg90.7%

        \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      5. distribute-frac-neg90.7%

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in90.7%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg90.7%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg90.7%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-190.7%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac91.8%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg91.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-191.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative91.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*91.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative91.8%

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

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-inv91.8%

        \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    6. Applied egg-rr91.8%

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    7. Taylor expanded in t around -inf 84.4%

      \[\leadsto x + \color{blue}{-1 \cdot \left(t \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*84.4%

        \[\leadsto x + \color{blue}{\left(-1 \cdot t\right) \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)} \]
      2. neg-mul-184.4%

        \[\leadsto x + \color{blue}{\left(-t\right)} \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right) \]
      3. distribute-lft-out--84.4%

        \[\leadsto x + \left(-t\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)\right)} \]
      4. associate-*r*84.3%

        \[\leadsto x + \color{blue}{\left(\left(-t\right) \cdot 0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
      5. distribute-lft-neg-in84.3%

        \[\leadsto x + \color{blue}{\left(-t \cdot 0.3333333333333333\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      6. distribute-rgt-neg-in84.3%

        \[\leadsto x + \color{blue}{\left(t \cdot \left(-0.3333333333333333\right)\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      7. metadata-eval84.3%

        \[\leadsto x + \left(t \cdot \color{blue}{-0.3333333333333333}\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
    9. Simplified84.3%

      \[\leadsto x + \color{blue}{\left(t \cdot -0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
    10. Taylor expanded in t around inf 64.6%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z}} \]
    11. Step-by-step derivation
      1. associate-*r/64.5%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} \]
      2. *-commutative64.5%

        \[\leadsto \frac{0.3333333333333333 \cdot t}{\color{blue}{z \cdot y}} \]
      3. *-commutative64.5%

        \[\leadsto \frac{\color{blue}{t \cdot 0.3333333333333333}}{z \cdot y} \]
      4. times-frac67.6%

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    12. Simplified67.6%

      \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.9 \cdot 10^{-103} \lor \neg \left(y \leq 2.25 \cdot 10^{-38}\right):\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 49.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{+39} \lor \neg \left(y \leq 1.7 \cdot 10^{+72}\right):\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.29999999999999979e39 or 1.6999999999999999e72 < y

    1. Initial program 95.4%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg95.4%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. +-commutative95.4%

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg95.4%

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

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in95.4%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg95.4%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg95.4%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-195.4%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac95.4%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg95.4%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-195.4%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative95.4%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*95.3%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative95.3%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-1}{z \cdot 3} \cdot y}\right)\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-inv99.7%

        \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    6. Applied egg-rr99.7%

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    7. Taylor expanded in t around -inf 87.2%

      \[\leadsto x + \color{blue}{-1 \cdot \left(t \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*87.2%

        \[\leadsto x + \color{blue}{\left(-1 \cdot t\right) \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)} \]
      2. neg-mul-187.2%

        \[\leadsto x + \color{blue}{\left(-t\right)} \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right) \]
      3. distribute-lft-out--87.2%

        \[\leadsto x + \left(-t\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)\right)} \]
      4. associate-*r*87.2%

        \[\leadsto x + \color{blue}{\left(\left(-t\right) \cdot 0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
      5. distribute-lft-neg-in87.2%

        \[\leadsto x + \color{blue}{\left(-t \cdot 0.3333333333333333\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      6. distribute-rgt-neg-in87.2%

        \[\leadsto x + \color{blue}{\left(t \cdot \left(-0.3333333333333333\right)\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      7. metadata-eval87.2%

        \[\leadsto x + \left(t \cdot \color{blue}{-0.3333333333333333}\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
    9. Simplified87.2%

      \[\leadsto x + \color{blue}{\left(t \cdot -0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
    10. Taylor expanded in y around inf 74.0%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]

    if -5.29999999999999979e39 < y < 1.6999999999999999e72

    1. Initial program 92.8%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg92.8%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. distribute-frac-neg92.8%

        \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      4. neg-mul-192.8%

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative92.8%

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac92.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define92.8%

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

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*92.9%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative92.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.3 \cdot 10^{+39} \lor \neg \left(y \leq 1.7 \cdot 10^{+72}\right):\\ \;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 49.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+33}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{+73}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\


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

    1. Initial program 96.0%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg96.0%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. distribute-frac-neg96.0%

        \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      4. neg-mul-196.0%

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative96.0%

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac96.0%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define96.0%

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

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*96.0%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative96.0%

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - 0.3333333333333333 \cdot \frac{1}{z}\right)} \]
    6. Taylor expanded in x around 0 72.3%

      \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
    7. Step-by-step derivation
      1. associate-*r/72.5%

        \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    8. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]

    if -1.09999999999999997e33 < y < 1.50000000000000005e73

    1. Initial program 92.8%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg92.8%

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

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. distribute-frac-neg92.8%

        \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      4. neg-mul-192.8%

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative92.8%

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac92.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define92.8%

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

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*92.9%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative92.9%

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

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

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

    if 1.50000000000000005e73 < y

    1. Initial program 94.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg94.5%

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      4. remove-double-neg94.5%

        \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      5. distribute-frac-neg94.5%

        \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
      6. distribute-neg-in94.5%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      7. remove-double-neg94.5%

        \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
      8. sub-neg94.5%

        \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
      9. neg-mul-194.5%

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac94.5%

        \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      11. distribute-frac-neg94.5%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-194.5%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
      13. *-commutative94.5%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      14. associate-/l*94.4%

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

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-1}{z \cdot 3} \cdot y}\right)\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-inv99.7%

        \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    6. Applied egg-rr99.7%

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{t \cdot \frac{1}{y}} - y\right) \]
    7. Taylor expanded in t around -inf 84.5%

      \[\leadsto x + \color{blue}{-1 \cdot \left(t \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*84.5%

        \[\leadsto x + \color{blue}{\left(-1 \cdot t\right) \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right)} \]
      2. neg-mul-184.5%

        \[\leadsto x + \color{blue}{\left(-t\right)} \cdot \left(0.3333333333333333 \cdot \frac{y}{t \cdot z} - 0.3333333333333333 \cdot \frac{1}{y \cdot z}\right) \]
      3. distribute-lft-out--84.5%

        \[\leadsto x + \left(-t\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)\right)} \]
      4. associate-*r*84.5%

        \[\leadsto x + \color{blue}{\left(\left(-t\right) \cdot 0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
      5. distribute-lft-neg-in84.5%

        \[\leadsto x + \color{blue}{\left(-t \cdot 0.3333333333333333\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      6. distribute-rgt-neg-in84.5%

        \[\leadsto x + \color{blue}{\left(t \cdot \left(-0.3333333333333333\right)\right)} \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
      7. metadata-eval84.5%

        \[\leadsto x + \left(t \cdot \color{blue}{-0.3333333333333333}\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right) \]
    9. Simplified84.5%

      \[\leadsto x + \color{blue}{\left(t \cdot -0.3333333333333333\right) \cdot \left(\frac{y}{t \cdot z} - \frac{1}{y \cdot z}\right)} \]
    10. Taylor expanded in y around inf 76.3%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification51.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{+33}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+73}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 95.4% accurate, 1.4× speedup?

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

\\
x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)
\end{array}
Derivation
  1. Initial program 93.7%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Step-by-step derivation
    1. sub-neg93.7%

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

      \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    3. +-commutative93.7%

      \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
    4. remove-double-neg93.7%

      \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
    5. distribute-frac-neg93.7%

      \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
    6. distribute-neg-in93.7%

      \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
    7. remove-double-neg93.7%

      \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
    8. sub-neg93.7%

      \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
    9. neg-mul-193.7%

      \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
    10. times-frac94.5%

      \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
    11. distribute-frac-neg94.5%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
    12. neg-mul-194.5%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
    13. *-commutative94.5%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
    14. associate-/l*94.5%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
    15. *-commutative94.5%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-1}{z \cdot 3} \cdot y}\right)\right) \]
  3. Simplified96.4%

    \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
  4. Add Preprocessing
  5. Add Preprocessing

Alternative 11: 30.7% accurate, 15.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 93.7%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Step-by-step derivation
    1. sub-neg93.7%

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

      \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    3. distribute-frac-neg93.7%

      \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    4. neg-mul-193.7%

      \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    5. *-commutative93.7%

      \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    6. times-frac93.7%

      \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    7. fma-define93.7%

      \[\leadsto x + \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    8. metadata-eval93.7%

      \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    9. associate-*l*93.8%

      \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
    10. *-commutative93.8%

      \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
  3. Simplified93.8%

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer Target 1: 95.9% accurate, 1.0× speedup?

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

\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}

Reproduce

?
herbie shell --seed 2024137 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))

  (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))