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

Percentage Accurate: 95.6% → 95.6%
Time: 12.0s
Alternatives: 17
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 17 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: 95.6% accurate, 1.0× speedup?

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

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

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Add Preprocessing
  3. Final simplification98.7%

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

Alternative 2: 75.6% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;y \leq -3 \cdot 10^{-53} \lor \neg \left(y \leq 10^{-158}\right):\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\

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


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

    1. Initial program 99.7%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num92.5%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/92.5%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv92.5%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval92.5%

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

      \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
    6. Step-by-step derivation
      1. *-lft-identity92.5%

        \[\leadsto x - \frac{\color{blue}{1 \cdot y}}{z \cdot 3} \]
      2. associate-*l/92.5%

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

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

        \[\leadsto x - \color{blue}{\frac{\frac{1}{3}}{z}} \cdot y \]
      5. metadata-eval92.5%

        \[\leadsto x - \frac{\color{blue}{0.3333333333333333}}{z} \cdot y \]
      6. *-commutative92.5%

        \[\leadsto x - \color{blue}{y \cdot \frac{0.3333333333333333}{z}} \]
    7. Simplified92.5%

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

    if -1.85e15 < y < -1.12e-13

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.12e-13 < y < -3.0000000000000002e-53 or 1.00000000000000006e-158 < y

    1. Initial program 99.8%

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

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

    if -3.0000000000000002e-53 < y < 1.00000000000000006e-158

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} \]
      2. times-frac74.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+15}:\\ \;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -1.12 \cdot 10^{-13}:\\ \;\;\;\;\frac{t}{y \cdot z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-53} \lor \neg \left(y \leq 10^{-158}\right):\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{y}{z} \cdot 0.3333333333333333\\ \mathbf{if}\;y \leq -1.85 \cdot 10^{+15}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-14}:\\ \;\;\;\;\frac{t}{y \cdot z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{-53} \lor \neg \left(y \leq 2.2 \cdot 10^{-156}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- x (* (/ y z) 0.3333333333333333))))
   (if (<= y -1.85e+15)
     t_1
     (if (<= y -4.2e-14)
       (* (/ t (* y z)) 0.3333333333333333)
       (if (or (<= y -3.1e-53) (not (<= y 2.2e-156)))
         t_1
         (* (/ t z) (/ 0.3333333333333333 y)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x - ((y / z) * 0.3333333333333333);
	double tmp;
	if (y <= -1.85e+15) {
		tmp = t_1;
	} else if (y <= -4.2e-14) {
		tmp = (t / (y * z)) * 0.3333333333333333;
	} else if ((y <= -3.1e-53) || !(y <= 2.2e-156)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x - ((y / z) * 0.3333333333333333d0)
    if (y <= (-1.85d+15)) then
        tmp = t_1
    else if (y <= (-4.2d-14)) then
        tmp = (t / (y * z)) * 0.3333333333333333d0
    else if ((y <= (-3.1d-53)) .or. (.not. (y <= 2.2d-156))) then
        tmp = t_1
    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 t_1 = x - ((y / z) * 0.3333333333333333);
	double tmp;
	if (y <= -1.85e+15) {
		tmp = t_1;
	} else if (y <= -4.2e-14) {
		tmp = (t / (y * z)) * 0.3333333333333333;
	} else if ((y <= -3.1e-53) || !(y <= 2.2e-156)) {
		tmp = t_1;
	} else {
		tmp = (t / z) * (0.3333333333333333 / y);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x - ((y / z) * 0.3333333333333333)
	tmp = 0
	if y <= -1.85e+15:
		tmp = t_1
	elif y <= -4.2e-14:
		tmp = (t / (y * z)) * 0.3333333333333333
	elif (y <= -3.1e-53) or not (y <= 2.2e-156):
		tmp = t_1
	else:
		tmp = (t / z) * (0.3333333333333333 / y)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x - Float64(Float64(y / z) * 0.3333333333333333))
	tmp = 0.0
	if (y <= -1.85e+15)
		tmp = t_1;
	elseif (y <= -4.2e-14)
		tmp = Float64(Float64(t / Float64(y * z)) * 0.3333333333333333);
	elseif ((y <= -3.1e-53) || !(y <= 2.2e-156))
		tmp = t_1;
	else
		tmp = Float64(Float64(t / z) * Float64(0.3333333333333333 / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x - ((y / z) * 0.3333333333333333);
	tmp = 0.0;
	if (y <= -1.85e+15)
		tmp = t_1;
	elseif (y <= -4.2e-14)
		tmp = (t / (y * z)) * 0.3333333333333333;
	elseif ((y <= -3.1e-53) || ~((y <= 2.2e-156)))
		tmp = t_1;
	else
		tmp = (t / z) * (0.3333333333333333 / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+15], t$95$1, If[LessEqual[y, -4.2e-14], N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], If[Or[LessEqual[y, -3.1e-53], N[Not[LessEqual[y, 2.2e-156]], $MachinePrecision]], t$95$1, N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -3.1 \cdot 10^{-53} \lor \neg \left(y \leq 2.2 \cdot 10^{-156}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.85e15 or -4.1999999999999998e-14 < y < -3.10000000000000015e-53 or 2.1999999999999999e-156 < y

    1. Initial program 99.8%

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

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

    if -1.85e15 < y < -4.1999999999999998e-14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000015e-53 < y < 2.1999999999999999e-156

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} \]
      2. times-frac74.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+15}:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-14}:\\ \;\;\;\;\frac{t}{y \cdot z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{-53} \lor \neg \left(y \leq 2.2 \cdot 10^{-156}\right):\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.7% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;y \leq -4.1 \cdot 10^{-53}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.85e15

    1. Initial program 99.7%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num92.5%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/92.5%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv92.5%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval92.5%

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

      \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
    6. Step-by-step derivation
      1. *-lft-identity92.5%

        \[\leadsto x - \frac{\color{blue}{1 \cdot y}}{z \cdot 3} \]
      2. associate-*l/92.5%

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

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

        \[\leadsto x - \color{blue}{\frac{\frac{1}{3}}{z}} \cdot y \]
      5. metadata-eval92.5%

        \[\leadsto x - \frac{\color{blue}{0.3333333333333333}}{z} \cdot y \]
      6. *-commutative92.5%

        \[\leadsto x - \color{blue}{y \cdot \frac{0.3333333333333333}{z}} \]
    7. Simplified92.5%

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

    if -1.85e15 < y < -1.62000000000000009e-15

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{y \cdot z} \cdot \color{blue}{\frac{1}{3}} \]
      4. div-inv71.8%

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

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

    if -1.62000000000000009e-15 < y < -4.1000000000000001e-53

    1. Initial program 99.8%

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

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

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

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

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

    if -4.1000000000000001e-53 < y < 9.1999999999999998e-156

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.1999999999999998e-156 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. add-sqr-sqrt89.4%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\frac{z}{0.3333333333333333}} \cdot \color{blue}{\left(-y\right)} \]
      9. associate-*l/36.4%

        \[\leadsto x - \color{blue}{\frac{1 \cdot \left(-y\right)}{\frac{z}{0.3333333333333333}}} \]
      10. div-inv36.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      11. metadata-eval36.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{z \cdot \color{blue}{3}} \]
      12. *-un-lft-identity36.4%

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

        \[\leadsto x - \color{blue}{\frac{\frac{-y}{z}}{3}} \]
      14. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z}}{3} \]
      15. sqrt-unprod57.0%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{z}}{3} \]
      16. sqr-neg57.0%

        \[\leadsto x - \frac{\frac{\sqrt{\color{blue}{y \cdot y}}}{z}}{3} \]
      17. sqrt-unprod89.5%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z}}{3} \]
      18. add-sqr-sqrt89.6%

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

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

Alternative 5: 75.7% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;y \leq -4 \cdot 10^{-52}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.85e15

    1. Initial program 99.7%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num92.5%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/92.5%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv92.5%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval92.5%

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

      \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
    6. Step-by-step derivation
      1. *-lft-identity92.5%

        \[\leadsto x - \frac{\color{blue}{1 \cdot y}}{z \cdot 3} \]
      2. associate-*l/92.5%

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

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

        \[\leadsto x - \color{blue}{\frac{\frac{1}{3}}{z}} \cdot y \]
      5. metadata-eval92.5%

        \[\leadsto x - \frac{\color{blue}{0.3333333333333333}}{z} \cdot y \]
      6. *-commutative92.5%

        \[\leadsto x - \color{blue}{y \cdot \frac{0.3333333333333333}{z}} \]
    7. Simplified92.5%

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

    if -1.85e15 < y < -8.9999999999999995e-14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.9999999999999995e-14 < y < -4e-52

    1. Initial program 99.8%

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

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

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

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

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

    if -4e-52 < y < 2.0500000000000001e-156

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0500000000000001e-156 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. add-sqr-sqrt89.4%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\frac{z}{0.3333333333333333}} \cdot \color{blue}{\left(-y\right)} \]
      9. associate-*l/36.4%

        \[\leadsto x - \color{blue}{\frac{1 \cdot \left(-y\right)}{\frac{z}{0.3333333333333333}}} \]
      10. div-inv36.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      11. metadata-eval36.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{z \cdot \color{blue}{3}} \]
      12. *-un-lft-identity36.4%

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

        \[\leadsto x - \color{blue}{\frac{\frac{-y}{z}}{3}} \]
      14. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z}}{3} \]
      15. sqrt-unprod57.0%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{z}}{3} \]
      16. sqr-neg57.0%

        \[\leadsto x - \frac{\frac{\sqrt{\color{blue}{y \cdot y}}}{z}}{3} \]
      17. sqrt-unprod89.5%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z}}{3} \]
      18. add-sqr-sqrt89.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+15}:\\ \;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-14}:\\ \;\;\;\;\frac{t}{y \cdot z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-52}:\\ \;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-156}:\\ \;\;\;\;\frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\frac{y}{z}}{3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 75.7% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.85e15

    1. Initial program 99.7%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num92.5%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/92.5%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv92.5%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval92.5%

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

      \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
    6. Step-by-step derivation
      1. *-lft-identity92.5%

        \[\leadsto x - \frac{\color{blue}{1 \cdot y}}{z \cdot 3} \]
      2. associate-*l/92.5%

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

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

        \[\leadsto x - \color{blue}{\frac{\frac{1}{3}}{z}} \cdot y \]
      5. metadata-eval92.5%

        \[\leadsto x - \frac{\color{blue}{0.3333333333333333}}{z} \cdot y \]
      6. *-commutative92.5%

        \[\leadsto x - \color{blue}{y \cdot \frac{0.3333333333333333}{z}} \]
    7. Simplified92.5%

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

    if -1.85e15 < y < -1.06e-13

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.06e-13 < y < -3.0000000000000002e-53

    1. Initial program 99.8%

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

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

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

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

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

    if -3.0000000000000002e-53 < y < 1.2e-155

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} \]
      2. times-frac74.3%

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

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

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

    if 1.2e-155 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. add-sqr-sqrt89.4%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\frac{z}{0.3333333333333333}} \cdot \color{blue}{\left(-y\right)} \]
      9. associate-*l/36.4%

        \[\leadsto x - \color{blue}{\frac{1 \cdot \left(-y\right)}{\frac{z}{0.3333333333333333}}} \]
      10. div-inv36.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      11. metadata-eval36.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{z \cdot \color{blue}{3}} \]
      12. *-un-lft-identity36.4%

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

        \[\leadsto x - \color{blue}{\frac{\frac{-y}{z}}{3}} \]
      14. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z}}{3} \]
      15. sqrt-unprod57.0%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{z}}{3} \]
      16. sqr-neg57.0%

        \[\leadsto x - \frac{\frac{\sqrt{\color{blue}{y \cdot y}}}{z}}{3} \]
      17. sqrt-unprod89.5%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z}}{3} \]
      18. add-sqr-sqrt89.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+15}:\\ \;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -1.06 \cdot 10^{-13}:\\ \;\;\;\;\frac{t}{y \cdot z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-53}:\\ \;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-155}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\frac{y}{z}}{3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.7% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;y \leq -3.25 \cdot 10^{-53}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.85e15

    1. Initial program 99.7%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num92.5%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/92.5%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv92.5%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval92.5%

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

      \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
    6. Step-by-step derivation
      1. *-lft-identity92.5%

        \[\leadsto x - \frac{\color{blue}{1 \cdot y}}{z \cdot 3} \]
      2. associate-*l/92.5%

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

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

        \[\leadsto x - \color{blue}{\frac{\frac{1}{3}}{z}} \cdot y \]
      5. metadata-eval92.5%

        \[\leadsto x - \frac{\color{blue}{0.3333333333333333}}{z} \cdot y \]
      6. *-commutative92.5%

        \[\leadsto x - \color{blue}{y \cdot \frac{0.3333333333333333}{z}} \]
    7. Simplified92.5%

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

    if -1.85e15 < y < -1.4e-14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4e-14 < y < -3.2499999999999998e-53

    1. Initial program 99.8%

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

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

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

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

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

    if -3.2499999999999998e-53 < y < 4.4000000000000002e-157

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} \]
      2. times-frac74.3%

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

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

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

    if 4.4000000000000002e-157 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num89.5%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/89.5%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv89.6%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval89.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+15}:\\ \;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-14}:\\ \;\;\;\;\frac{t}{y \cdot z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq -3.25 \cdot 10^{-53}:\\ \;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{-157}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 75.8% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;y \leq -6.7 \cdot 10^{-53}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.85e15

    1. Initial program 99.7%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num92.5%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/92.5%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv92.5%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval92.5%

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

      \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
    6. Step-by-step derivation
      1. *-lft-identity92.5%

        \[\leadsto x - \frac{\color{blue}{1 \cdot y}}{z \cdot 3} \]
      2. associate-*l/92.5%

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

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

        \[\leadsto x - \color{blue}{\frac{\frac{1}{3}}{z}} \cdot y \]
      5. metadata-eval92.5%

        \[\leadsto x - \frac{\color{blue}{0.3333333333333333}}{z} \cdot y \]
      6. *-commutative92.5%

        \[\leadsto x - \color{blue}{y \cdot \frac{0.3333333333333333}{z}} \]
    7. Simplified92.5%

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

    if -1.85e15 < y < -8.9999999999999995e-14

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.9999999999999995e-14 < y < -6.69999999999999957e-53

    1. Initial program 99.8%

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

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

    if -6.69999999999999957e-53 < y < 2.1999999999999999e-156

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} \]
      2. times-frac74.3%

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

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

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

    if 2.1999999999999999e-156 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num89.5%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/89.5%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv89.6%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval89.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+15}:\\ \;\;\;\;x - y \cdot \frac{0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-14}:\\ \;\;\;\;\frac{t}{y \cdot z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq -6.7 \cdot 10^{-53}:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-156}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 92.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 0.072:\\
\;\;\;\;x + \frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\

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


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

    1. Initial program 99.7%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num93.7%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/93.6%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv93.6%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval93.6%

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

      \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
    6. Step-by-step derivation
      1. *-lft-identity93.6%

        \[\leadsto x - \frac{\color{blue}{1 \cdot y}}{z \cdot 3} \]
      2. associate-*l/93.6%

        \[\leadsto x - \color{blue}{\frac{1}{z \cdot 3} \cdot y} \]
      3. *-commutative93.6%

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

        \[\leadsto x - \color{blue}{\frac{\frac{1}{3}}{z}} \cdot y \]
      5. metadata-eval93.7%

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

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

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

    if -1.2e33 < y < 0.0719999999999999946

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{\frac{t}{z} \cdot 0.3333333333333333}}{y} \]
      6. div-inv91.2%

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

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

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

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

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

    if 0.0719999999999999946 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. add-sqr-sqrt98.1%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\frac{z}{0.3333333333333333}} \cdot \color{blue}{\left(-y\right)} \]
      9. associate-*l/31.4%

        \[\leadsto x - \color{blue}{\frac{1 \cdot \left(-y\right)}{\frac{z}{0.3333333333333333}}} \]
      10. div-inv31.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      11. metadata-eval31.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{z \cdot \color{blue}{3}} \]
      12. *-un-lft-identity31.4%

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

        \[\leadsto x - \color{blue}{\frac{\frac{-y}{z}}{3}} \]
      14. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z}}{3} \]
      15. sqrt-unprod54.7%

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

        \[\leadsto x - \frac{\frac{\sqrt{\color{blue}{y \cdot y}}}{z}}{3} \]
      17. sqrt-unprod98.3%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z}}{3} \]
      18. add-sqr-sqrt98.4%

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

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

Alternative 10: 92.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 7800:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\

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


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

    1. Initial program 99.7%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num93.7%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/93.6%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv93.6%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval93.6%

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

      \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
    6. Step-by-step derivation
      1. *-lft-identity93.6%

        \[\leadsto x - \frac{\color{blue}{1 \cdot y}}{z \cdot 3} \]
      2. associate-*l/93.6%

        \[\leadsto x - \color{blue}{\frac{1}{z \cdot 3} \cdot y} \]
      3. *-commutative93.6%

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

        \[\leadsto x - \color{blue}{\frac{\frac{1}{3}}{z}} \cdot y \]
      5. metadata-eval93.7%

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

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

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

    if -2.19999999999999994e33 < y < 7800

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{1}{3} \cdot \frac{\frac{t}{z}}{y}} \]
      11. metadata-eval91.2%

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

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

    if 7800 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. add-sqr-sqrt98.1%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\frac{z}{0.3333333333333333}} \cdot \color{blue}{\left(-y\right)} \]
      9. associate-*l/31.4%

        \[\leadsto x - \color{blue}{\frac{1 \cdot \left(-y\right)}{\frac{z}{0.3333333333333333}}} \]
      10. div-inv31.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      11. metadata-eval31.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{z \cdot \color{blue}{3}} \]
      12. *-un-lft-identity31.4%

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

        \[\leadsto x - \color{blue}{\frac{\frac{-y}{z}}{3}} \]
      14. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z}}{3} \]
      15. sqrt-unprod54.7%

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

        \[\leadsto x - \frac{\frac{\sqrt{\color{blue}{y \cdot y}}}{z}}{3} \]
      17. sqrt-unprod98.3%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z}}{3} \]
      18. add-sqr-sqrt98.4%

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

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

Alternative 11: 89.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. clear-num93.7%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{z}{0.3333333333333333}}} \cdot y \]
      4. associate-*l/93.6%

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

        \[\leadsto x - \frac{\color{blue}{y}}{\frac{z}{0.3333333333333333}} \]
      6. div-inv93.6%

        \[\leadsto x - \frac{y}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      7. metadata-eval93.6%

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

      \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
    6. Step-by-step derivation
      1. *-lft-identity93.6%

        \[\leadsto x - \frac{\color{blue}{1 \cdot y}}{z \cdot 3} \]
      2. associate-*l/93.6%

        \[\leadsto x - \color{blue}{\frac{1}{z \cdot 3} \cdot y} \]
      3. *-commutative93.6%

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

        \[\leadsto x - \color{blue}{\frac{\frac{1}{3}}{z}} \cdot y \]
      5. metadata-eval93.7%

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

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

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

    if -6.4999999999999994e32 < y < 1.5e-6

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5e-6 < y

    1. Initial program 99.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333}{z} \cdot y} \]
      3. add-sqr-sqrt98.1%

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

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

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

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

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

        \[\leadsto x - \frac{1}{\frac{z}{0.3333333333333333}} \cdot \color{blue}{\left(-y\right)} \]
      9. associate-*l/31.4%

        \[\leadsto x - \color{blue}{\frac{1 \cdot \left(-y\right)}{\frac{z}{0.3333333333333333}}} \]
      10. div-inv31.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      11. metadata-eval31.4%

        \[\leadsto x - \frac{1 \cdot \left(-y\right)}{z \cdot \color{blue}{3}} \]
      12. *-un-lft-identity31.4%

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

        \[\leadsto x - \color{blue}{\frac{\frac{-y}{z}}{3}} \]
      14. add-sqr-sqrt0.0%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z}}{3} \]
      15. sqrt-unprod54.7%

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

        \[\leadsto x - \frac{\frac{\sqrt{\color{blue}{y \cdot y}}}{z}}{3} \]
      17. sqrt-unprod98.3%

        \[\leadsto x - \frac{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z}}{3} \]
      18. add-sqr-sqrt98.4%

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

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

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

Alternative 12: 42.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+65}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.49999999999999986e65 or 1.2e-155 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.49999999999999986e65 < y < 1.2e-155

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 47.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+35}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.8000000000000002e35 or 3.50000000000000023e45 < x

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.8000000000000002e35 < x < 3.50000000000000023e45

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 95.5% accurate, 1.2× speedup?

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

\\
x + \frac{\frac{t}{y \cdot z} - \frac{y}{z}}{3}
\end{array}
Derivation
  1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{\frac{\frac{t}{y} - y}{z}}{3}} \]
  10. Applied egg-rr96.9%

    \[\leadsto x + \color{blue}{\frac{\frac{\frac{t}{y} - y}{z}}{3}} \]
  11. Step-by-step derivation
    1. div-sub96.9%

      \[\leadsto x + \frac{\color{blue}{\frac{\frac{t}{y}}{z} - \frac{y}{z}}}{3} \]
    2. associate-/l/98.7%

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

      \[\leadsto x + \frac{\frac{t}{\color{blue}{y \cdot z}} - \frac{y}{z}}{3} \]
  12. Applied egg-rr98.7%

    \[\leadsto x + \frac{\color{blue}{\frac{t}{y \cdot z} - \frac{y}{z}}}{3} \]
  13. Add Preprocessing

Alternative 15: 95.8% accurate, 1.4× speedup?

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

\\
x + \frac{\frac{\frac{t}{y} - y}{z}}{3}
\end{array}
Derivation
  1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{\frac{\frac{t}{y} - y}{z}}{3}} \]
  10. Applied egg-rr96.9%

    \[\leadsto x + \color{blue}{\frac{\frac{\frac{t}{y} - y}{z}}{3}} \]
  11. Add Preprocessing

Alternative 16: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 30.5% 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 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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