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

Percentage Accurate: 95.7% → 97.7%
Time: 9.9s
Alternatives: 13
Speedup: 1.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 13 alternatives:

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

Initial Program: 95.7% 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: 97.7% accurate, 0.1× 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^{+290}:\\ \;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{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+290)
   (+ x (fma -0.3333333333333333 (/ y z) (/ t (* z (* y 3.0)))))
   (+ x (* (/ 0.3333333333333333 z) (- (/ t 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+290) {
		tmp = x + fma(-0.3333333333333333, (y / z), (t / (z * (y * 3.0))));
	} else {
		tmp = x + ((0.3333333333333333 / z) * ((t / 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+290)
		tmp = Float64(x + fma(-0.3333333333333333, Float64(y / z), Float64(t / Float64(z * Float64(y * 3.0)))));
	else
		tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y)));
	end
	return 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+290], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $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^{+290}:\\
\;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{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.00000000000000012e290

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified97.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

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

    1. Initial program 90.8%

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

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

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

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

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

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

        \[\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) \]
      7. distribute-frac-neg90.8%

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

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

        \[\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) \]
      10. sub-neg90.8%

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

        \[\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) \]
      12. times-frac96.2%

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

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

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

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

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

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

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

    \[\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^{+290}:\\ \;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 59.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{-0.3333333333333333}{z}\\ t_2 := t \cdot \frac{0.3333333333333333}{y \cdot z}\\ \mathbf{if}\;y \leq -1.7 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1820000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-158}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-116}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-93}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+14}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (/ -0.3333333333333333 z)))
        (t_2 (* t (/ 0.3333333333333333 (* y z)))))
   (if (<= y -1.7e+101)
     t_1
     (if (<= y -3e+39)
       x
       (if (<= y -1820000000000.0)
         t_1
         (if (<= y -4e-158)
           x
           (if (<= y 2.5e-116)
             t_2
             (if (<= y 4.5e-93)
               x
               (if (<= y 1.75e+14) t_2 (* -0.3333333333333333 (/ y z)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (-0.3333333333333333 / z);
	double t_2 = t * (0.3333333333333333 / (y * z));
	double tmp;
	if (y <= -1.7e+101) {
		tmp = t_1;
	} else if (y <= -3e+39) {
		tmp = x;
	} else if (y <= -1820000000000.0) {
		tmp = t_1;
	} else if (y <= -4e-158) {
		tmp = x;
	} else if (y <= 2.5e-116) {
		tmp = t_2;
	} else if (y <= 4.5e-93) {
		tmp = x;
	} else if (y <= 1.75e+14) {
		tmp = t_2;
	} else {
		tmp = -0.3333333333333333 * (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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * ((-0.3333333333333333d0) / z)
    t_2 = t * (0.3333333333333333d0 / (y * z))
    if (y <= (-1.7d+101)) then
        tmp = t_1
    else if (y <= (-3d+39)) then
        tmp = x
    else if (y <= (-1820000000000.0d0)) then
        tmp = t_1
    else if (y <= (-4d-158)) then
        tmp = x
    else if (y <= 2.5d-116) then
        tmp = t_2
    else if (y <= 4.5d-93) then
        tmp = x
    else if (y <= 1.75d+14) then
        tmp = t_2
    else
        tmp = (-0.3333333333333333d0) * (y / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (-0.3333333333333333 / z);
	double t_2 = t * (0.3333333333333333 / (y * z));
	double tmp;
	if (y <= -1.7e+101) {
		tmp = t_1;
	} else if (y <= -3e+39) {
		tmp = x;
	} else if (y <= -1820000000000.0) {
		tmp = t_1;
	} else if (y <= -4e-158) {
		tmp = x;
	} else if (y <= 2.5e-116) {
		tmp = t_2;
	} else if (y <= 4.5e-93) {
		tmp = x;
	} else if (y <= 1.75e+14) {
		tmp = t_2;
	} else {
		tmp = -0.3333333333333333 * (y / z);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (-0.3333333333333333 / z)
	t_2 = t * (0.3333333333333333 / (y * z))
	tmp = 0
	if y <= -1.7e+101:
		tmp = t_1
	elif y <= -3e+39:
		tmp = x
	elif y <= -1820000000000.0:
		tmp = t_1
	elif y <= -4e-158:
		tmp = x
	elif y <= 2.5e-116:
		tmp = t_2
	elif y <= 4.5e-93:
		tmp = x
	elif y <= 1.75e+14:
		tmp = t_2
	else:
		tmp = -0.3333333333333333 * (y / z)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(-0.3333333333333333 / z))
	t_2 = Float64(t * Float64(0.3333333333333333 / Float64(y * z)))
	tmp = 0.0
	if (y <= -1.7e+101)
		tmp = t_1;
	elseif (y <= -3e+39)
		tmp = x;
	elseif (y <= -1820000000000.0)
		tmp = t_1;
	elseif (y <= -4e-158)
		tmp = x;
	elseif (y <= 2.5e-116)
		tmp = t_2;
	elseif (y <= 4.5e-93)
		tmp = x;
	elseif (y <= 1.75e+14)
		tmp = t_2;
	else
		tmp = Float64(-0.3333333333333333 * Float64(y / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (-0.3333333333333333 / z);
	t_2 = t * (0.3333333333333333 / (y * z));
	tmp = 0.0;
	if (y <= -1.7e+101)
		tmp = t_1;
	elseif (y <= -3e+39)
		tmp = x;
	elseif (y <= -1820000000000.0)
		tmp = t_1;
	elseif (y <= -4e-158)
		tmp = x;
	elseif (y <= 2.5e-116)
		tmp = t_2;
	elseif (y <= 4.5e-93)
		tmp = x;
	elseif (y <= 1.75e+14)
		tmp = t_2;
	else
		tmp = -0.3333333333333333 * (y / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.7e+101], t$95$1, If[LessEqual[y, -3e+39], x, If[LessEqual[y, -1820000000000.0], t$95$1, If[LessEqual[y, -4e-158], x, If[LessEqual[y, 2.5e-116], t$95$2, If[LessEqual[y, 4.5e-93], x, If[LessEqual[y, 1.75e+14], t$95$2, N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{-0.3333333333333333}{z}\\
t_2 := t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{if}\;y \leq -1.7 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -3 \cdot 10^{+39}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -1820000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -4 \cdot 10^{-158}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{-116}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-93}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.75 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.70000000000000009e101 or -3e39 < y < -1.82e12

    1. Initial program 95.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg95.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) \]
      7. distribute-frac-neg95.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) \]
      8. distribute-neg-in95.5%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg95.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) \]
      10. sub-neg95.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) \]
      11. neg-mul-195.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) \]
      12. times-frac95.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) \]
      13. distribute-frac-neg95.5%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-195.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) \]
      15. *-commutative95.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) \]
      16. associate-/l*95.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) \]
      17. *-commutative95.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.8%

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

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

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

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

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

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

    if -1.70000000000000009e101 < y < -3e39 or -1.82e12 < y < -4.00000000000000026e-158 or 2.5000000000000001e-116 < y < 4.5000000000000002e-93

    1. Initial program 98.0%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg98.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) \]
      7. distribute-frac-neg98.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) \]
      8. distribute-neg-in98.0%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg98.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) \]
      10. sub-neg98.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) \]
      11. neg-mul-198.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) \]
      12. times-frac92.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) \]
      13. distribute-frac-neg92.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-192.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) \]
      15. *-commutative92.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) \]
      16. associate-/l*92.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) \]
      17. *-commutative92.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. Simplified92.9%

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

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

    if -4.00000000000000026e-158 < y < 2.5000000000000001e-116 or 4.5000000000000002e-93 < y < 1.75e14

    1. Initial program 94.2%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg94.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) \]
      7. distribute-frac-neg94.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) \]
      8. distribute-neg-in94.2%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg94.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) \]
      10. sub-neg94.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) \]
      11. neg-mul-194.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) \]
      12. times-frac91.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) \]
      13. distribute-frac-neg91.4%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-191.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) \]
      15. *-commutative91.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) \]
      16. associate-/l*91.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) \]
      17. *-commutative91.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. Simplified91.3%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{z} + x \cdot y}{y}} \]
    6. Taylor expanded in t around inf 75.1%

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

        \[\leadsto \frac{\color{blue}{\frac{0.3333333333333333 \cdot t}{z}}}{y} \]
      2. associate-*l/75.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{0.3333333333333333}{z}}{y} \cdot t} \]
      3. associate-/l/69.6%

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{y \cdot z}} \cdot t \]
    10. Applied egg-rr69.6%

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

    if 1.75e14 < y

    1. Initial program 99.7%

      \[\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 95.2%

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    4. Taylor expanded in x around 0 66.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+101}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -3 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1820000000000:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-158}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-116}:\\ \;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-93}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+14}:\\ \;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 97.8% 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^{+290}:\\ \;\;\;\;\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(\frac{t}{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+290)
   (+ (+ x (/ t (* z (* y 3.0)))) (/ y (* z -3.0)))
   (+ x (* (/ 0.3333333333333333 z) (- (/ t 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+290) {
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
	} else {
		tmp = x + ((0.3333333333333333 / z) * ((t / 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+290) then
        tmp = (x + (t / (z * (y * 3.0d0)))) + (y / (z * (-3.0d0)))
    else
        tmp = x + ((0.3333333333333333d0 / z) * ((t / 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+290) {
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
	} else {
		tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= 2e+290:
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0))
	else:
		tmp = x + ((0.3333333333333333 / z) * ((t / 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+290)
		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 / 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+290)
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
	else
		tmp = x + ((0.3333333333333333 / z) * ((t / 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+290], 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 / y), $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^{+290}:\\
\;\;\;\;\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(\frac{t}{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.00000000000000012e290

    1. Initial program 97.9%

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

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

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

        \[\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*97.9%

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

        \[\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-neg297.9%

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

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

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

      \[\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.00000000000000012e290 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y)))

    1. Initial program 90.8%

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

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

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

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

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

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

        \[\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) \]
      7. distribute-frac-neg90.8%

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

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

        \[\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) \]
      10. sub-neg90.8%

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

        \[\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) \]
      12. times-frac96.2%

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

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

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

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

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

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

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

    \[\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^{+290}:\\ \;\;\;\;\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(\frac{t}{y} - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 97.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-82} \lor \neg \left(y \leq 2.46 \cdot 10^{-88}\right):\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1e-82 or 2.4599999999999999e-88 < y

    1. Initial program 98.4%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg98.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) \]
      7. distribute-frac-neg98.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) \]
      8. distribute-neg-in98.4%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg98.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) \]
      10. sub-neg98.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) \]
      11. neg-mul-198.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) \]
      12. times-frac97.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) \]
      13. distribute-frac-neg97.8%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-197.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) \]
      15. *-commutative97.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) \]
      16. associate-/l*97.9%

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

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

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

    if -1e-82 < y < 2.4599999999999999e-88

    1. Initial program 93.2%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg93.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) \]
      7. distribute-frac-neg93.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) \]
      8. distribute-neg-in93.2%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg93.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) \]
      10. sub-neg93.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) \]
      11. neg-mul-193.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) \]
      12. times-frac88.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) \]
      13. distribute-frac-neg88.4%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-188.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) \]
      15. *-commutative88.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) \]
      16. associate-/l*88.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) \]
      17. *-commutative88.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. Simplified88.4%

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

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

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

Alternative 5: 89.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2200000000000:\\ \;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 23500000000:\\ \;\;\;\;x + \frac{t}{z \cdot \left(y \cdot 3\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2200000000000.0)
   (+ x (/ (* y -0.3333333333333333) z))
   (if (<= y 23500000000.0)
     (+ x (/ t (* z (* y 3.0))))
     (- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2200000000000.0) {
		tmp = x + ((y * -0.3333333333333333) / z);
	} else if (y <= 23500000000.0) {
		tmp = x + (t / (z * (y * 3.0)));
	} else {
		tmp = x - ((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 <= (-2200000000000.0d0)) then
        tmp = x + ((y * (-0.3333333333333333d0)) / z)
    else if (y <= 23500000000.0d0) then
        tmp = x + (t / (z * (y * 3.0d0)))
    else
        tmp = x - ((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 <= -2200000000000.0) {
		tmp = x + ((y * -0.3333333333333333) / z);
	} else if (y <= 23500000000.0) {
		tmp = x + (t / (z * (y * 3.0)));
	} else {
		tmp = x - ((y / z) * 0.3333333333333333);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -2200000000000.0:
		tmp = x + ((y * -0.3333333333333333) / z)
	elif y <= 23500000000.0:
		tmp = x + (t / (z * (y * 3.0)))
	else:
		tmp = x - ((y / z) * 0.3333333333333333)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2200000000000.0)
		tmp = Float64(x + Float64(Float64(y * -0.3333333333333333) / z));
	elseif (y <= 23500000000.0)
		tmp = Float64(x + Float64(t / Float64(z * Float64(y * 3.0))));
	else
		tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -2200000000000.0)
		tmp = x + ((y * -0.3333333333333333) / z);
	elseif (y <= 23500000000.0)
		tmp = x + (t / (z * (y * 3.0)));
	else
		tmp = x - ((y / z) * 0.3333333333333333);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -2200000000000.0], N[(x + N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 23500000000.0], N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2200000000000:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 23500000000:\\
\;\;\;\;x + \frac{t}{z \cdot \left(y \cdot 3\right)}\\

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


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

    1. Initial program 96.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-neg96.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+96.3%

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

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

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

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

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

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

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

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

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

      \[\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 z around 0 99.8%

      \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot y + 0.3333333333333333 \cdot \frac{t}{y}}{z}} \]
    6. Taylor expanded in y around inf 95.7%

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

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

        \[\leadsto x + \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    8. Simplified95.7%

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

    if -2.2e12 < y < 2.35e10

    1. Initial program 95.2%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg95.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) \]
      7. distribute-frac-neg95.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) \]
      8. distribute-neg-in95.2%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg95.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) \]
      10. sub-neg95.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) \]
      11. neg-mul-195.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) \]
      12. times-frac91.2%

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{y \cdot z} \cdot 0.3333333333333333} \]
      2. associate-/r*85.7%

        \[\leadsto x + \color{blue}{\frac{\frac{t}{y}}{z}} \cdot 0.3333333333333333 \]
      3. associate-*l/85.7%

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

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

        \[\leadsto x + \frac{\color{blue}{\frac{\frac{t}{y}}{3}}}{z} \]
      6. div-inv85.7%

        \[\leadsto x + \color{blue}{\frac{\frac{t}{y}}{3} \cdot \frac{1}{z}} \]
      7. associate-/l/85.7%

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

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

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

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

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

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

    if 2.35e10 < y

    1. Initial program 99.7%

      \[\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 95.2%

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

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

Alternative 6: 89.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1950000000000:\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 6.5 \cdot 10^{+14}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\

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


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

    1. Initial program 96.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-neg96.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+96.3%

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

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

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

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

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

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

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

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

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

      \[\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 z around 0 99.8%

      \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot y + 0.3333333333333333 \cdot \frac{t}{y}}{z}} \]
    6. Taylor expanded in y around inf 95.7%

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

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

        \[\leadsto x + \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    8. Simplified95.7%

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

    if -1.95e12 < y < 6.5e14

    1. Initial program 95.2%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg95.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) \]
      7. distribute-frac-neg95.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) \]
      8. distribute-neg-in95.2%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg95.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) \]
      10. sub-neg95.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) \]
      11. neg-mul-195.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) \]
      12. times-frac91.2%

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

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

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

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

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

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

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

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

    if 6.5e14 < y

    1. Initial program 99.7%

      \[\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 95.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1950000000000:\\ \;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+14}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 76.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 2.5 \cdot 10^{-116}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{\frac{1}{y}}{3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9e-158

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\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 z around 0 97.7%

      \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot y + 0.3333333333333333 \cdot \frac{t}{y}}{z}} \]
    6. Taylor expanded in y around inf 84.4%

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

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative84.4%

        \[\leadsto x + \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    8. Simplified84.4%

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

    if -9e-158 < y < 2.5000000000000001e-116

    1. Initial program 92.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg92.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) \]
      7. distribute-frac-neg92.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) \]
      8. distribute-neg-in92.5%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg92.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) \]
      10. sub-neg92.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) \]
      11. neg-mul-192.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) \]
      12. times-frac90.2%

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

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

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

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

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

        \[\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. Simplified90.1%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{z} + x \cdot y}{y}} \]
    6. Taylor expanded in t around inf 81.9%

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

        \[\leadsto \frac{\color{blue}{\frac{0.3333333333333333 \cdot t}{z}}}{y} \]
      2. associate-*l/81.9%

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

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

      \[\leadsto \frac{\color{blue}{t \cdot \frac{0.3333333333333333}{z}}}{y} \]
    9. Step-by-step derivation
      1. *-commutative81.9%

        \[\leadsto \frac{\color{blue}{\frac{0.3333333333333333}{z} \cdot t}}{y} \]
      2. associate-/l*72.9%

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{t}{y}} \]
      3. metadata-eval72.9%

        \[\leadsto \frac{\color{blue}{\frac{1}{3}}}{z} \cdot \frac{t}{y} \]
      4. associate-/r*72.9%

        \[\leadsto \color{blue}{\frac{1}{3 \cdot z}} \cdot \frac{t}{y} \]
      5. *-commutative72.9%

        \[\leadsto \frac{1}{\color{blue}{z \cdot 3}} \cdot \frac{t}{y} \]
      6. associate-/r/72.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot 3}{\frac{t}{y}}}} \]
      7. clear-num72.9%

        \[\leadsto \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}} \]
      8. div-inv72.9%

        \[\leadsto \frac{\color{blue}{t \cdot \frac{1}{y}}}{z \cdot 3} \]
      9. times-frac81.9%

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{\frac{1}{y}}{3}} \]
    10. Applied egg-rr81.9%

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

    if 2.5000000000000001e-116 < y

    1. Initial program 99.7%

      \[\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 82.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-158}:\\ \;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-116}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{\frac{1}{y}}{3}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 46.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -5 \cdot 10^{+122}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \cdot 3 \leq 2 \cdot 10^{-63}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z #s(literal 3 binary64)) < -4.99999999999999989e122 or 2.00000000000000013e-63 < (*.f64 z #s(literal 3 binary64))

    1. Initial program 99.0%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg99.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) \]
      7. distribute-frac-neg99.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) \]
      8. distribute-neg-in99.0%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg99.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) \]
      10. sub-neg99.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) \]
      11. neg-mul-199.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) \]
      12. times-frac89.3%

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

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

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

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
      16. associate-/l*89.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) \]
      17. *-commutative89.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. Simplified89.3%

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

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

    if -4.99999999999999989e122 < (*.f64 z #s(literal 3 binary64)) < 2.00000000000000013e-63

    1. Initial program 94.2%

      \[\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 56.2%

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    4. Taylor expanded in x around 0 47.3%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 75.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.78 \cdot 10^{-158} \lor \neg \left(y \leq 4.6 \cdot 10^{-116}\right):\\
\;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.77999999999999992e-158 or 4.60000000000000003e-116 < y

    1. Initial program 98.1%

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

        \[\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+98.1%

        \[\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-neg98.1%

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

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

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

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

        \[\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-eval98.2%

        \[\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*98.2%

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

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

      \[\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 z around 0 97.1%

      \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot y + 0.3333333333333333 \cdot \frac{t}{y}}{z}} \]
    6. Taylor expanded in y around inf 83.3%

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

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative83.3%

        \[\leadsto x + \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    8. Simplified83.3%

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

    if -1.77999999999999992e-158 < y < 4.60000000000000003e-116

    1. Initial program 92.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg92.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) \]
      7. distribute-frac-neg92.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) \]
      8. distribute-neg-in92.5%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg92.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) \]
      10. sub-neg92.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) \]
      11. neg-mul-192.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) \]
      12. times-frac90.2%

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

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

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

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

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

        \[\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. Simplified90.1%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{z} + x \cdot y}{y}} \]
    6. Taylor expanded in t around inf 81.9%

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

        \[\leadsto \frac{\color{blue}{\frac{0.3333333333333333 \cdot t}{z}}}{y} \]
      2. associate-*l/81.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{0.3333333333333333}{z}}{y} \cdot t} \]
      3. associate-/l/74.9%

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{y \cdot z}} \cdot t \]
    10. Applied egg-rr74.9%

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

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

Alternative 10: 76.8% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.20000000000000008e-158

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\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 z around 0 97.7%

      \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot y + 0.3333333333333333 \cdot \frac{t}{y}}{z}} \]
    6. Taylor expanded in y around inf 84.4%

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

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative84.4%

        \[\leadsto x + \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    8. Simplified84.4%

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

    if -8.20000000000000008e-158 < y < 3.00000000000000026e-116

    1. Initial program 92.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg92.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) \]
      7. distribute-frac-neg92.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) \]
      8. distribute-neg-in92.5%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg92.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) \]
      10. sub-neg92.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) \]
      11. neg-mul-192.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) \]
      12. times-frac90.2%

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

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

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

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

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

        \[\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. Simplified90.1%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{z} + x \cdot y}{y}} \]
    6. Taylor expanded in t around inf 81.9%

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

    if 3.00000000000000026e-116 < y

    1. Initial program 99.7%

      \[\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 82.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{-158}:\\ \;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-116}:\\ \;\;\;\;\frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 75.0% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9e-158

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\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 z around 0 97.7%

      \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot y + 0.3333333333333333 \cdot \frac{t}{y}}{z}} \]
    6. Taylor expanded in y around inf 84.4%

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

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative84.4%

        \[\leadsto x + \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    8. Simplified84.4%

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

    if -9e-158 < y < 2.7999999999999999e-116

    1. Initial program 92.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. remove-double-neg92.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) \]
      7. distribute-frac-neg92.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) \]
      8. distribute-neg-in92.5%

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg92.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) \]
      10. sub-neg92.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) \]
      11. neg-mul-192.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) \]
      12. times-frac90.2%

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

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

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

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

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

        \[\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. Simplified90.1%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{z} + x \cdot y}{y}} \]
    6. Taylor expanded in t around inf 81.9%

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

        \[\leadsto \frac{\color{blue}{\frac{0.3333333333333333 \cdot t}{z}}}{y} \]
      2. associate-*l/81.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{0.3333333333333333}{z}}{y} \cdot t} \]
      3. associate-/l/74.9%

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{y \cdot z}} \cdot t \]
    10. Applied egg-rr74.9%

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

    if 2.7999999999999999e-116 < y

    1. Initial program 99.7%

      \[\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 82.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-158}:\\ \;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-116}:\\ \;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 95.8% 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 96.4%

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
    6. remove-double-neg96.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) \]
    7. distribute-frac-neg96.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) \]
    8. distribute-neg-in96.4%

      \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
    9. remove-double-neg96.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) \]
    10. sub-neg96.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) \]
    11. neg-mul-196.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) \]
    12. times-frac94.2%

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

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

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

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

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

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

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

Alternative 13: 30.4% 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 96.4%

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
    6. remove-double-neg96.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) \]
    7. distribute-frac-neg96.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) \]
    8. distribute-neg-in96.4%

      \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
    9. remove-double-neg96.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) \]
    10. sub-neg96.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) \]
    11. neg-mul-196.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) \]
    12. times-frac94.2%

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

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

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

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

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

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

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

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

Developer target: 96.2% 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 2024101 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

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

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