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

Percentage Accurate: 95.7% → 98.0%
Time: 10.4s
Alternatives: 14
Speedup: 0.7×

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 14 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: 98.0% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq 2.9 \cdot 10^{-63}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\

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


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

    1. Initial program 94.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-neg94.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+94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.59999999999999998e-91 < y < 2.89999999999999975e-63

    1. Initial program 90.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-neg90.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+90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{{\left(\frac{y}{t}\right)}^{-1}} - y\right) \]
    7. Step-by-step derivation
      1. unpow-188.5%

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

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

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

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

        \[\leadsto x + 0.3333333333333333 \cdot \color{blue}{\frac{\frac{t}{z}}{y}} \]
    11. Simplified99.8%

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

    if 2.89999999999999975e-63 < y

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative98.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. Step-by-step derivation
      1. clear-num99.8%

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

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

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{{\left(\frac{y}{t}\right)}^{-1}} - y\right) \]
    7. Step-by-step derivation
      1. unpow-199.8%

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

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

Alternative 2: 90.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -7 \cdot 10^{-15}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}\\

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

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


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

    1. Initial program 94.5%

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

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

    if -9.5000000000000002e67 < y < -7.0000000000000001e-15

    1. Initial program 95.8%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Step-by-step derivation
      1. distribute-lft-out--87.9%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}{z} \]
      2. *-commutative87.9%

        \[\leadsto \frac{\color{blue}{\left(\frac{t}{y} - y\right) \cdot 0.3333333333333333}}{z} \]
    5. Applied egg-rr87.9%

      \[\leadsto \frac{\color{blue}{\left(\frac{t}{y} - y\right) \cdot 0.3333333333333333}}{z} \]

    if -7.0000000000000001e-15 < y < 6.39999999999999989e74

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{{\left(\frac{y}{t}\right)}^{-1}} - y\right) \]
    7. Step-by-step derivation
      1. unpow-192.4%

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

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

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

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

        \[\leadsto x + 0.3333333333333333 \cdot \color{blue}{\frac{\frac{t}{z}}{y}} \]
    11. Simplified96.8%

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

    if 6.39999999999999989e74 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\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 t around 0 95.9%

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
    6. Step-by-step derivation
      1. neg-mul-195.9%

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

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

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

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot \left(-y\right)}{-z}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}}{-z} \]
      4. sqrt-unprod13.5%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-z} \]
      5. sqr-neg13.5%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \sqrt{\color{blue}{y \cdot y}}}{-z} \]
      6. sqrt-unprod28.1%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}{-z} \]
      7. add-sqr-sqrt28.1%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{y}}{-z} \]
      8. distribute-rgt-neg-out28.1%

        \[\leadsto x + \frac{\color{blue}{0.3333333333333333 \cdot \left(-y\right)}}{-z} \]
      9. add-sqr-sqrt0.0%

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

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-z} \]
      11. sqr-neg59.7%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \sqrt{\color{blue}{y \cdot y}}}{-z} \]
      12. sqrt-unprod95.7%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}{-z} \]
      13. add-sqr-sqrt96.0%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{y}}{-z} \]
    9. Applied egg-rr96.0%

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

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

Alternative 3: 98.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-92} \lor \neg \left(y \leq 2.9 \cdot 10^{-63}\right):\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.00000000000000011e-92 or 2.89999999999999975e-63 < y

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative97.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

    if -5.00000000000000011e-92 < y < 2.89999999999999975e-63

    1. Initial program 90.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-neg90.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+90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{{\left(\frac{y}{t}\right)}^{-1}} - y\right) \]
    7. Step-by-step derivation
      1. unpow-188.5%

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

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

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

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

        \[\leadsto x + 0.3333333333333333 \cdot \color{blue}{\frac{\frac{t}{z}}{y}} \]
    11. Simplified99.8%

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

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

Alternative 4: 61.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-17}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\

\mathbf{elif}\;y \leq 5.4 \cdot 10^{+17}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{+101}:\\
\;\;\;\;y \cdot \frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.3999999999999999e-17

    1. Initial program 94.9%

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

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

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

    if -1.3999999999999999e-17 < y < 5.4e17

    1. Initial program 92.4%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Taylor expanded in t around inf 66.1%

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

    if 5.4e17 < y < 2.6e101

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

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

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

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

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

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac95.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-define95.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-eval95.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*95.2%

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

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

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

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

    if 2.6e101 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 97.4% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.00000000000000005e54

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000005e54 < t

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      10. times-frac96.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) \]
      11. distribute-frac-neg96.3%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      12. neg-mul-196.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) \]
      13. *-commutative96.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) \]
      14. associate-/l*96.3%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
      15. *-commutative96.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. Simplified98.3%

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

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

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

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{{\left(\frac{y}{t}\right)}^{-1}} - y\right) \]
    7. Step-by-step derivation
      1. unpow-198.3%

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

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

Alternative 6: 91.7% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 94.9%

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

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

    if -1.7500000000000001e-14 < y < 6.39999999999999989e74

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{{\left(\frac{y}{t}\right)}^{-1}} - y\right) \]
    7. Step-by-step derivation
      1. unpow-192.4%

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

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

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

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

        \[\leadsto x + 0.3333333333333333 \cdot \color{blue}{\frac{\frac{t}{z}}{y}} \]
    11. Simplified96.8%

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

    if 6.39999999999999989e74 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\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 t around 0 95.9%

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
    6. Step-by-step derivation
      1. neg-mul-195.9%

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

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

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

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot \left(-y\right)}{-z}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}}{-z} \]
      4. sqrt-unprod13.5%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-z} \]
      5. sqr-neg13.5%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \sqrt{\color{blue}{y \cdot y}}}{-z} \]
      6. sqrt-unprod28.1%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}{-z} \]
      7. add-sqr-sqrt28.1%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{y}}{-z} \]
      8. distribute-rgt-neg-out28.1%

        \[\leadsto x + \frac{\color{blue}{0.3333333333333333 \cdot \left(-y\right)}}{-z} \]
      9. add-sqr-sqrt0.0%

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

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-z} \]
      11. sqr-neg59.7%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \sqrt{\color{blue}{y \cdot y}}}{-z} \]
      12. sqrt-unprod95.7%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}{-z} \]
      13. add-sqr-sqrt96.0%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{y}}{-z} \]
    9. Applied egg-rr96.0%

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

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

Alternative 7: 89.1% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 94.9%

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

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

    if -2.35e-17 < y < 5.50000000000000008e85

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.50000000000000008e85 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
    6. Step-by-step derivation
      1. neg-mul-199.8%

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

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

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

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot \left(-y\right)}{-z}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}}{-z} \]
      4. sqrt-unprod8.0%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-z} \]
      5. sqr-neg8.0%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \sqrt{\color{blue}{y \cdot y}}}{-z} \]
      6. sqrt-unprod24.7%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}{-z} \]
      7. add-sqr-sqrt24.7%

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

        \[\leadsto x + \frac{\color{blue}{0.3333333333333333 \cdot \left(-y\right)}}{-z} \]
      9. add-sqr-sqrt0.0%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}}{-z} \]
      10. sqrt-unprod58.3%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-z} \]
      11. sqr-neg58.3%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \sqrt{\color{blue}{y \cdot y}}}{-z} \]
      12. sqrt-unprod99.6%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}{-z} \]
      13. add-sqr-sqrt99.9%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{y}}{-z} \]
    9. Applied egg-rr99.9%

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

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

Alternative 8: 76.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.1 \cdot 10^{-91} \lor \neg \left(y \leq 7.4 \cdot 10^{-35}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.0999999999999995e-91 or 7.3999999999999998e-35 < y

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{{\left(\frac{y}{t}\right)}^{-1}} - y\right) \]
    7. Step-by-step derivation
      1. unpow-199.8%

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

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

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

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

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

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

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

    if -6.0999999999999995e-91 < y < 7.3999999999999998e-35

    1. Initial program 91.6%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Taylor expanded in t around inf 71.5%

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

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

Alternative 9: 76.0% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 94.6%

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

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

    if -1.05e-93 < y < 4.50000000000000009e-38

    1. Initial program 91.6%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Taylor expanded in t around inf 71.5%

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

    if 4.50000000000000009e-38 < y

    1. Initial program 98.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg98.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+98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \color{blue}{\left(-1 \cdot y\right)} \]
    6. Step-by-step derivation
      1. neg-mul-184.6%

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

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

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

        \[\leadsto x + \color{blue}{\frac{-0.3333333333333333 \cdot \left(-y\right)}{-z}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}}{-z} \]
      4. sqrt-unprod27.4%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-z} \]
      5. sqr-neg27.4%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \sqrt{\color{blue}{y \cdot y}}}{-z} \]
      6. sqrt-unprod37.3%

        \[\leadsto x + \frac{-0.3333333333333333 \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}{-z} \]
      7. add-sqr-sqrt37.3%

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

        \[\leadsto x + \frac{\color{blue}{0.3333333333333333 \cdot \left(-y\right)}}{-z} \]
      9. add-sqr-sqrt0.0%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}}{-z} \]
      10. sqrt-unprod60.0%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-z} \]
      11. sqr-neg60.0%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \sqrt{\color{blue}{y \cdot y}}}{-z} \]
      12. sqrt-unprod84.5%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}}{-z} \]
      13. add-sqr-sqrt84.7%

        \[\leadsto x + \frac{0.3333333333333333 \cdot \color{blue}{y}}{-z} \]
    9. Applied egg-rr84.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{-93}:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-38}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 76.1% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 94.6%

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

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

    if -1.7000000000000001e-92 < y < 1.89999999999999985e-36

    1. Initial program 91.6%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Taylor expanded in t around inf 71.5%

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

    if 1.89999999999999985e-36 < y

    1. Initial program 98.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg98.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+98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\color{blue}{{\left(\frac{y}{t}\right)}^{-1}} - y\right) \]
    7. Step-by-step derivation
      1. unpow-199.8%

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

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

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

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

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

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

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

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

Alternative 11: 47.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-15} \lor \neg \left(y \leq 5.9 \cdot 10^{+100}\right):\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.1999999999999998e-15 or 5.90000000000000027e100 < y

    1. Initial program 96.5%

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

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

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

    if -6.1999999999999998e-15 < y < 5.90000000000000027e100

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 47.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\

\mathbf{elif}\;y \leq 5.8 \cdot 10^{+100}:\\
\;\;\;\;x\\

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


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

    1. Initial program 94.9%

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

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

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

    if -1.85000000000000001e-14 < y < 5.8000000000000001e100

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8000000000000001e100 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 47.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\

\mathbf{elif}\;y \leq 5.8 \cdot 10^{+100}:\\
\;\;\;\;x\\

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


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

    1. Initial program 94.9%

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

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

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

    if -1.7999999999999999e-14 < y < 5.8000000000000001e100

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8000000000000001e100 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 31.2% 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 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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

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

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