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

Percentage Accurate: 95.6% → 99.5%
Time: 10.2s
Alternatives: 16
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 95.6% 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: 99.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 3) < -1e-22 or 4.9999999999999999e-49 < (*.f64 z 3)

    1. Initial program 99.8%

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

    if -1e-22 < (*.f64 z 3) < 4.9999999999999999e-49

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-22} \lor \neg \left(z \cdot 3 \leq 5 \cdot 10^{-49}\right):\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)\\ \end{array} \]

Alternative 2: 97.3% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) < 5.0000000000000004e283

    1. Initial program 97.2%

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

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

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

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

    if 5.0000000000000004e283 < (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y)))

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 82.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+57}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

\mathbf{elif}\;z \cdot 3 \leq 5 \cdot 10^{+71}:\\
\;\;\;\;\frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z 3) < -1.00000000000000005e57

    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. associate-/r*99.9%

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

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. metadata-eval83.8%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac83.9%

        \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
      3. *-un-lft-identity83.9%

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative83.9%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot 3}} \]
    6. Applied egg-rr83.9%

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

    if -1.00000000000000005e57 < (*.f64 z 3) < 4.99999999999999972e71

    1. Initial program 90.7%

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

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

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

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

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

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y \cdot z} - \frac{y}{z}\right)} \]
      2. associate-/r*85.3%

        \[\leadsto 0.3333333333333333 \cdot \left(\color{blue}{\frac{\frac{t}{y}}{z}} - \frac{y}{z}\right) \]
      3. div-sub86.6%

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

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

        \[\leadsto \frac{\color{blue}{\left(\frac{t}{y} - y\right) \cdot 0.3333333333333333}}{z} \]
      6. associate-*r/87.1%

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

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

    if 4.99999999999999972e71 < (*.f64 z 3)

    1. Initial program 99.7%

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

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

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. metadata-eval79.5%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac79.5%

        \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
      3. *-un-lft-identity79.5%

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative79.5%

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

        \[\leadsto x - \color{blue}{\frac{\frac{y}{z}}{3}} \]
    6. Applied egg-rr79.5%

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

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

Alternative 4: 60.8% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq -8.8 \cdot 10^{-19}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+63}:\\
\;\;\;\;x\\

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


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

    1. Initial program 94.3%

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub79.9%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--79.9%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    9. Simplified79.9%

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

    if -6.0000000000000005e121 < y < -8.7999999999999994e-19 or 9e-73 < y < 2.1999999999999999e63

    1. Initial program 98.0%

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

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

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

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

    if -8.7999999999999994e-19 < y < 9e-73

    1. Initial program 89.9%

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub67.0%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--67.0%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}{z} \]
    6. Simplified67.0%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{0.3333333333333333}{\frac{y}{t}}}}{z} \]
    9. Simplified64.7%

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{1}{\frac{y}{t}}} \]
      4. clear-num64.7%

        \[\leadsto \frac{0.3333333333333333}{z} \cdot \color{blue}{\frac{t}{y}} \]
    11. Applied egg-rr64.7%

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

    if 2.1999999999999999e63 < 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. associate-/r*97.6%

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub77.9%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--77.9%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    9. Simplified77.9%

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z}} \]
    12. Simplified77.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+121}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -8.8 \cdot 10^{-19}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-73}:\\ \;\;\;\;\frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+63}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]

Alternative 5: 62.7% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq -6.6 \cdot 10^{-18}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;y \leq 4.9 \cdot 10^{+53}:\\
\;\;\;\;x\\

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


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

    1. Initial program 94.3%

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub79.9%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--79.9%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    9. Simplified79.9%

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

    if -8.5e123 < y < -6.6000000000000003e-18 or 3.0000000000000001e-113 < y < 4.90000000000000018e53

    1. Initial program 96.6%

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

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

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

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

    if -6.6000000000000003e-18 < y < 3.0000000000000001e-113

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub67.5%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--67.5%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}{z} \]
    6. Simplified67.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{0.3333333333333333}{\frac{y}{t}}}}{z} \]
    9. Simplified66.0%

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{1}{\frac{y}{t}}} \]
      4. clear-num66.0%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    11. Applied egg-rr70.8%

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

    if 4.90000000000000018e53 < 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. associate-/r*97.6%

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub77.9%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--77.9%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    9. Simplified77.9%

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z}} \]
    12. Simplified77.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{+123}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-113}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+53}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]

Alternative 6: 87.6% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 94.3%

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

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

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. metadata-eval99.7%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac99.9%

        \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
      3. *-un-lft-identity99.9%

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative99.9%

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

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

    if -1.7e117 < y < 8.99999999999999991e39

    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. associate-/r*98.2%

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

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

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

    if 8.99999999999999991e39 < 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. associate-/r*97.7%

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

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. metadata-eval99.7%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac99.8%

        \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
      3. *-un-lft-identity99.8%

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative99.8%

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

        \[\leadsto x - \color{blue}{\frac{\frac{y}{z}}{3}} \]
    6. Applied egg-rr99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+117}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+39}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\frac{y}{z}}{3}\\ \end{array} \]

Alternative 7: 87.6% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 94.3%

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

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

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. metadata-eval99.7%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac99.9%

        \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
      3. *-un-lft-identity99.9%

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative99.9%

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

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

    if -1.7e117 < y < 7.0000000000000003e39

    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. associate-/r*98.2%

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot t}{\color{blue}{z \cdot y}} + x \]
    6. Applied egg-rr86.3%

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

    if 7.0000000000000003e39 < 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. associate-/r*97.7%

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

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. metadata-eval99.7%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac99.8%

        \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
      3. *-un-lft-identity99.8%

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative99.8%

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

        \[\leadsto x - \color{blue}{\frac{\frac{y}{z}}{3}} \]
    6. Applied egg-rr99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+117}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+39}:\\ \;\;\;\;x + \frac{t \cdot 0.3333333333333333}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\frac{y}{z}}{3}\\ \end{array} \]

Alternative 8: 87.3% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 94.3%

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

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

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. metadata-eval99.7%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac99.9%

        \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
      3. *-un-lft-identity99.9%

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative99.9%

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

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

    if -1.7e117 < y < 1.22e41

    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. associate-/r*98.2%

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

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

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z} + x} \]
    5. Step-by-step derivation
      1. *-un-lft-identity86.3%

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333}{z} \cdot \color{blue}{\frac{1}{\frac{y}{t}}} + x \]
      4. un-div-inv87.7%

        \[\leadsto \color{blue}{\frac{\frac{0.3333333333333333}{z}}{\frac{y}{t}}} + x \]
    8. Applied egg-rr87.7%

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

    if 1.22e41 < 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. associate-/r*97.7%

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

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. metadata-eval99.7%

        \[\leadsto x - \color{blue}{\frac{1}{3}} \cdot \frac{y}{z} \]
      2. times-frac99.8%

        \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
      3. *-un-lft-identity99.8%

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative99.8%

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

        \[\leadsto x - \color{blue}{\frac{\frac{y}{z}}{3}} \]
    6. Applied egg-rr99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+117}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{+41}:\\ \;\;\;\;x + \frac{\frac{0.3333333333333333}{z}}{\frac{y}{t}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\frac{y}{z}}{3}\\ \end{array} \]

Alternative 9: 78.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-17} \lor \neg \left(y \leq 3.4 \cdot 10^{-113}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.5499999999999999e-17 or 3.4000000000000002e-113 < y

    1. Initial program 97.0%

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

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

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

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

    if -1.5499999999999999e-17 < y < 3.4000000000000002e-113

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub67.5%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--67.5%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}{z} \]
    6. Simplified67.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{0.3333333333333333}{\frac{y}{t}}}}{z} \]
    9. Simplified66.0%

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{1}{\frac{y}{t}}} \]
      4. clear-num66.0%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    11. Applied egg-rr70.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{-17} \lor \neg \left(y \leq 3.4 \cdot 10^{-113}\right):\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \end{array} \]

Alternative 10: 78.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-18} \lor \neg \left(y \leq 2.8 \cdot 10^{-113}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.02e-18 or 2.8e-113 < y

    1. Initial program 97.0%

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

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

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. metadata-eval87.3%

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

        \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
      3. *-un-lft-identity87.4%

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative87.4%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot 3}} \]
    6. Applied egg-rr87.4%

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

    if -1.02e-18 < y < 2.8e-113

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub67.5%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--67.5%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}{z} \]
    6. Simplified67.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{0.3333333333333333}{\frac{y}{t}}}}{z} \]
    9. Simplified66.0%

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{1}{\frac{y}{t}}} \]
      4. clear-num66.0%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    11. Applied egg-rr70.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.02 \cdot 10^{-18} \lor \neg \left(y \leq 2.8 \cdot 10^{-113}\right):\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \end{array} \]

Alternative 11: 78.7% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.4 \cdot 10^{-19} \lor \neg \left(y \leq 1.6 \cdot 10^{-113}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.3999999999999996e-19 or 1.6000000000000001e-113 < y

    1. Initial program 97.0%

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

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

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. metadata-eval87.3%

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

        \[\leadsto x - \color{blue}{\frac{1 \cdot y}{3 \cdot z}} \]
      3. *-un-lft-identity87.4%

        \[\leadsto x - \frac{\color{blue}{y}}{3 \cdot z} \]
      4. *-commutative87.4%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot 3}} \]
    6. Applied egg-rr87.4%

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

    if -8.3999999999999996e-19 < y < 1.6000000000000001e-113

    1. Initial program 90.2%

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub67.5%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--67.5%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}{z} \]
    6. Simplified67.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{0.3333333333333333}{\frac{y}{t}}}}{z} \]
    9. Simplified66.0%

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{1}{\frac{y}{t}}} \]
      4. clear-num66.0%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    11. Applied egg-rr70.8%

      \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    12. Step-by-step derivation
      1. clear-num70.7%

        \[\leadsto \frac{t}{z} \cdot \color{blue}{\frac{1}{\frac{y}{0.3333333333333333}}} \]
      2. un-div-inv70.8%

        \[\leadsto \color{blue}{\frac{\frac{t}{z}}{\frac{y}{0.3333333333333333}}} \]
      3. div-inv70.9%

        \[\leadsto \frac{\frac{t}{z}}{\color{blue}{y \cdot \frac{1}{0.3333333333333333}}} \]
      4. metadata-eval70.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.4 \cdot 10^{-19} \lor \neg \left(y \leq 1.6 \cdot 10^{-113}\right):\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t}{z}}{y \cdot 3}\\ \end{array} \]

Alternative 12: 96.0% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 48.0% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+118} \lor \neg \left(y \leq 2.85 \cdot 10^{+62}\right):\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.50000000000000003e118 or 2.84999999999999999e62 < y

    1. Initial program 97.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--78.8%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}{z} \]
    6. Simplified78.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z}} \]
    12. Simplified78.7%

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

    if -7.50000000000000003e118 < y < 2.84999999999999999e62

    1. Initial program 92.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.5 \cdot 10^{+118} \lor \neg \left(y \leq 2.85 \cdot 10^{+62}\right):\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 14: 48.0% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;y \leq 1.65 \cdot 10^{+64}:\\
\;\;\;\;x\\

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


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

    1. Initial program 94.3%

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

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

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

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. *-commutative79.7%

        \[\leadsto \color{blue}{\frac{y}{z} \cdot -0.3333333333333333} \]
    6. Simplified79.7%

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

    if -1.7e117 < y < 1.64999999999999994e64

    1. Initial program 92.5%

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

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

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

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

    if 1.64999999999999994e64 < 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. associate-/r*97.6%

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub77.9%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--77.9%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    9. Simplified77.9%

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z}} \]
    12. Simplified77.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+117}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+64}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]

Alternative 15: 48.0% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;y \leq 2.85 \cdot 10^{+63}:\\
\;\;\;\;x\\

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


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

    1. Initial program 94.3%

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub79.9%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--79.9%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    9. Simplified79.9%

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

    if -7.99999999999999955e119 < y < 2.8500000000000001e63

    1. Initial program 92.5%

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

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

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

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

    if 2.8500000000000001e63 < 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. associate-/r*97.6%

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub77.9%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
      5. distribute-lft-out--77.9%

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
    9. Simplified77.9%

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z}} \]
    12. Simplified77.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+119}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 2.85 \cdot 10^{+63}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]

Alternative 16: 30.1% 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.1%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification32.2%

    \[\leadsto x \]

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

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

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