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

Percentage Accurate: 95.6% → 97.3%
Time: 16.6s
Alternatives: 20
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 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: 97.3% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq 20000000:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{3 \cdot \left(z \cdot y\right)}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z 3.0) 20000000.0)
   (+ x (/ (- (/ t y) y) (* z 3.0)))
   (+ x (fma -0.3333333333333333 (/ y z) (/ t (* 3.0 (* z y)))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * 3.0) <= 20000000.0) {
		tmp = x + (((t / y) - y) / (z * 3.0));
	} else {
		tmp = x + fma(-0.3333333333333333, (y / z), (t / (3.0 * (z * y))));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * 3.0) <= 20000000.0)
		tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0)));
	else
		tmp = Float64(x + fma(-0.3333333333333333, Float64(y / z), Float64(t / Float64(3.0 * Float64(z * y)))));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 20000000.0], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + N[(t / N[(3.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 20000000:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\

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


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

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

    if 2e7 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

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

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

Alternative 2: 59.8% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.65:\\
\;\;\;\;\frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+136}:\\
\;\;\;\;\frac{\frac{y}{z}}{-3}\\

\mathbf{elif}\;y \leq 10^{+180}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1.1499999999999999

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around inf 69.3%

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

    if -1.1499999999999999 < y < -1.45e-231

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around 0 75.8%

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

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

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

    if -1.45e-231 < y < 1.6499999999999999

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in x around 0 68.5%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z} + \frac{-t}{y} \cdot \frac{-0.3333333333333333}{z}} \]
      6. +-commutative68.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot 0.3333333333333333}{y \cdot z}} + y \cdot \frac{-0.3333333333333333}{z} \]
      15. times-frac68.5%

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

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\frac{-0.3333333333333333}{z} \cdot y} \]
      17. metadata-eval68.5%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      18. distribute-neg-frac68.5%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\left(-\frac{0.3333333333333333}{z}\right)} \cdot y \]
      19. cancel-sign-sub-inv68.5%

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

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

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

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

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

    if 1.6499999999999999 < y < 1.54999999999999992e136

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around inf 59.9%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
      3. clear-num60.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{y \cdot -0.3333333333333333}}} \]
      4. reciprocal-define31.9%

        \[\leadsto \color{blue}{\mathsf{reciprocal}\left(\left(\frac{z}{y \cdot -0.3333333333333333}\right)\right)} \]
      5. *-commutative31.9%

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

        \[\leadsto \mathsf{reciprocal}\left(\color{blue}{\left(\frac{\frac{z}{-0.3333333333333333}}{y}\right)}\right) \]
      7. div-inv31.9%

        \[\leadsto \mathsf{reciprocal}\left(\left(\frac{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}}{y}\right)\right) \]
      8. metadata-eval31.9%

        \[\leadsto \mathsf{reciprocal}\left(\left(\frac{z \cdot \color{blue}{-3}}{y}\right)\right) \]
    9. Applied egg-rr31.9%

      \[\leadsto \color{blue}{\mathsf{reciprocal}\left(\left(\frac{z \cdot -3}{y}\right)\right)} \]
    10. Step-by-step derivation
      1. reciprocal-undefine59.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot -3}{y}}} \]
      2. clear-num59.9%

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

        \[\leadsto \color{blue}{\frac{\frac{y}{z}}{-3}} \]
    11. Applied egg-rr59.9%

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

    if 1.54999999999999992e136 < y < 1e180

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e180 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around inf 88.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
      3. div-inv88.4%

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

        \[\leadsto \frac{y}{z \cdot \color{blue}{-3}} \]
    9. Applied egg-rr88.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-231}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\ \mathbf{elif}\;y \leq 1.65:\\ \;\;\;\;\frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+136}:\\ \;\;\;\;\frac{\frac{y}{z}}{-3}\\ \mathbf{elif}\;y \leq 10^{+180}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 59.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq 64:\\
\;\;\;\;\frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+136}:\\
\;\;\;\;\frac{\frac{y}{z}}{-3}\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+180}:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around inf 69.3%

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

    if -600 < y < 64

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in x around 0 68.6%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z} + \frac{-t}{y} \cdot \frac{-0.3333333333333333}{z}} \]
      6. +-commutative68.6%

        \[\leadsto \color{blue}{\frac{-t}{y} \cdot \frac{-0.3333333333333333}{z} + y \cdot \frac{-0.3333333333333333}{z}} \]
      7. *-commutative68.6%

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{0.3333333333333333} \cdot t}{z}}{y} + y \cdot \frac{-0.3333333333333333}{z} \]
      13. *-commutative72.7%

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

        \[\leadsto \color{blue}{\frac{t \cdot 0.3333333333333333}{y \cdot z}} + y \cdot \frac{-0.3333333333333333}{z} \]
      15. times-frac68.6%

        \[\leadsto \color{blue}{\frac{t}{y} \cdot \frac{0.3333333333333333}{z}} + y \cdot \frac{-0.3333333333333333}{z} \]
      16. *-commutative68.6%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\frac{-0.3333333333333333}{z} \cdot y} \]
      17. metadata-eval68.6%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      18. distribute-neg-frac68.6%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\left(-\frac{0.3333333333333333}{z}\right)} \cdot y \]
      19. cancel-sign-sub-inv68.6%

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

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

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

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

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

    if 64 < y < 1.54999999999999992e136

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around inf 59.9%

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

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

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
      3. clear-num60.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{y \cdot -0.3333333333333333}}} \]
      4. reciprocal-define31.9%

        \[\leadsto \color{blue}{\mathsf{reciprocal}\left(\left(\frac{z}{y \cdot -0.3333333333333333}\right)\right)} \]
      5. *-commutative31.9%

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

        \[\leadsto \mathsf{reciprocal}\left(\color{blue}{\left(\frac{\frac{z}{-0.3333333333333333}}{y}\right)}\right) \]
      7. div-inv31.9%

        \[\leadsto \mathsf{reciprocal}\left(\left(\frac{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}}{y}\right)\right) \]
      8. metadata-eval31.9%

        \[\leadsto \mathsf{reciprocal}\left(\left(\frac{z \cdot \color{blue}{-3}}{y}\right)\right) \]
    9. Applied egg-rr31.9%

      \[\leadsto \color{blue}{\mathsf{reciprocal}\left(\left(\frac{z \cdot -3}{y}\right)\right)} \]
    10. Step-by-step derivation
      1. reciprocal-undefine59.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot -3}{y}}} \]
      2. clear-num59.9%

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

        \[\leadsto \color{blue}{\frac{\frac{y}{z}}{-3}} \]
    11. Applied egg-rr59.9%

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

    if 1.54999999999999992e136 < y < 1.2499999999999999e180

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2499999999999999e180 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around inf 88.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
      3. div-inv88.4%

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

        \[\leadsto \frac{y}{z \cdot \color{blue}{-3}} \]
    9. Applied egg-rr88.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -600:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 64:\\ \;\;\;\;\frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+136}:\\ \;\;\;\;\frac{\frac{y}{z}}{-3}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+180}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.2% accurate, 0.7× speedup?

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

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

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

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


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

    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. remove-double-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000018e25 < (*.f64 z 3) < 1.00000000000000001e55

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in x around 0 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot 0.3333333333333333}{y \cdot z}} + y \cdot \frac{-0.3333333333333333}{z} \]
      15. times-frac88.3%

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

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\frac{-0.3333333333333333}{z} \cdot y} \]
      17. metadata-eval88.3%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      18. distribute-neg-frac88.3%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\left(-\frac{0.3333333333333333}{z}\right)} \cdot y \]
      19. cancel-sign-sub-inv88.3%

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

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

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

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

    if 1.00000000000000001e55 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 5: 75.1% accurate, 0.7× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -0.0400000000000000008 or 2.50000000000000012e-5 < y

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0400000000000000008 < y < -2.39999999999999992e-231

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around 0 75.8%

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

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

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

    if -2.39999999999999992e-231 < y < 2.50000000000000012e-5

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in x around 0 68.5%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z} + \frac{-t}{y} \cdot \frac{-0.3333333333333333}{z}} \]
      6. +-commutative68.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot 0.3333333333333333}{y \cdot z}} + y \cdot \frac{-0.3333333333333333}{z} \]
      15. times-frac68.5%

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

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\frac{-0.3333333333333333}{z} \cdot y} \]
      17. metadata-eval68.5%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      18. distribute-neg-frac68.5%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\left(-\frac{0.3333333333333333}{z}\right)} \cdot y \]
      19. cancel-sign-sub-inv68.5%

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

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

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

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

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

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

Alternative 6: 75.0% accurate, 0.7× speedup?

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

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

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

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

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


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.25 < y < -2.0999999999999998e-230

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around 0 75.8%

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

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

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

    if -2.0999999999999998e-230 < y < 8.4999999999999997e-12

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in x around 0 68.5%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z} + \frac{-t}{y} \cdot \frac{-0.3333333333333333}{z}} \]
      6. +-commutative68.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot 0.3333333333333333}{y \cdot z}} + y \cdot \frac{-0.3333333333333333}{z} \]
      15. times-frac68.5%

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

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\frac{-0.3333333333333333}{z} \cdot y} \]
      17. metadata-eval68.5%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      18. distribute-neg-frac68.5%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\left(-\frac{0.3333333333333333}{z}\right)} \cdot y \]
      19. cancel-sign-sub-inv68.5%

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

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

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

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

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

    if 8.4999999999999997e-12 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 75.0% accurate, 0.7× speedup?

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

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

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

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

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


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.65999999999999992 < y < -1.35000000000000006e-230

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around 0 75.8%

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

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

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

    if -1.35000000000000006e-230 < y < 8.59999999999999971e-12

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in x around 0 68.5%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z} + \frac{-t}{y} \cdot \frac{-0.3333333333333333}{z}} \]
      6. +-commutative68.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot 0.3333333333333333}{y \cdot z}} + y \cdot \frac{-0.3333333333333333}{z} \]
      15. times-frac68.5%

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

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\frac{-0.3333333333333333}{z} \cdot y} \]
      17. metadata-eval68.5%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      18. distribute-neg-frac68.5%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\left(-\frac{0.3333333333333333}{z}\right)} \cdot y \]
      19. cancel-sign-sub-inv68.5%

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

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

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

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

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

    if 8.59999999999999971e-12 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 75.1% accurate, 0.7× speedup?

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

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

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

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

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


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

    1. Initial program 97.9%

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

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

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

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

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

    if -0.042999999999999997 < y < -5.20000000000000006e-231

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around 0 75.8%

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

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

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

    if -5.20000000000000006e-231 < y < 7.99999999999999984e-12

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in x around 0 68.5%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z} + \frac{-t}{y} \cdot \frac{-0.3333333333333333}{z}} \]
      6. +-commutative68.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t \cdot 0.3333333333333333}{y \cdot z}} + y \cdot \frac{-0.3333333333333333}{z} \]
      15. times-frac68.5%

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

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\frac{-0.3333333333333333}{z} \cdot y} \]
      17. metadata-eval68.5%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      18. distribute-neg-frac68.5%

        \[\leadsto \frac{t}{y} \cdot \frac{0.3333333333333333}{z} + \color{blue}{\left(-\frac{0.3333333333333333}{z}\right)} \cdot y \]
      19. cancel-sign-sub-inv68.5%

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

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

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

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

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

    if 7.99999999999999984e-12 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 97.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 5000000000:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\

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


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

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

    if 5e9 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 97.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 20000000:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\

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


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

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

    if 2e7 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

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

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

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

Alternative 11: 89.5% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 97.9%

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

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

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

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

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

    if -1.6499999999999999 < y < 0.0379999999999999991

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0379999999999999991 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 89.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 97.9%

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

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

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

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

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

    if -1500 < y < 0.022499999999999999

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.022499999999999999 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 89.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 0.0062:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot y}}{3}\\

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


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

    1. Initial program 97.9%

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

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

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

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

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

    if -1e5 < y < 0.00619999999999999978

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{t}{y \cdot z}}}{3} + x \]
    9. Applied egg-rr90.2%

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

    if 0.00619999999999999978 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 92.1% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 97.9%

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

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

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

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

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

    if -5.9000000000000004 < y < 6

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z} + x} \]
    7. Simplified90.2%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z} + x} \]
    8. Step-by-step derivation
      1. associate-*r/90.2%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} + x \]
      2. *-commutative90.2%

        \[\leadsto \frac{0.3333333333333333 \cdot t}{\color{blue}{z \cdot y}} + x \]
      3. associate-/r*94.3%

        \[\leadsto \color{blue}{\frac{\frac{0.3333333333333333 \cdot t}{z}}{y}} + x \]
      4. *-commutative94.3%

        \[\leadsto \frac{\frac{\color{blue}{t \cdot 0.3333333333333333}}{z}}{y} + x \]
    9. Applied egg-rr94.3%

      \[\leadsto \color{blue}{\frac{\frac{t \cdot 0.3333333333333333}{z}}{y}} + x \]

    if 6 < y

    1. Initial program 96.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-neg96.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+96.8%

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. remove-double-neg96.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)}\right) \]
      4. distribute-frac-neg96.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right)\right) \]
      5. unsub-neg96.8%

        \[\leadsto x + \color{blue}{\left(\left(-\frac{y}{z \cdot 3}\right) - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      6. neg-mul-196.8%

        \[\leadsto x + \left(\color{blue}{-1 \cdot \frac{y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. associate-*r/96.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1 \cdot y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      8. associate-*l/96.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{z \cdot 3} \cdot y} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. neg-mul-196.8%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. times-frac96.8%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}}\right) \]
      11. distribute-lft-out--99.7%

        \[\leadsto x + \color{blue}{\frac{-1}{z \cdot 3} \cdot \left(y - \frac{t}{y}\right)} \]
      12. *-commutative99.7%

        \[\leadsto x + \frac{-1}{\color{blue}{3 \cdot z}} \cdot \left(y - \frac{t}{y}\right) \]
      13. associate-/r*99.7%

        \[\leadsto x + \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot \left(y - \frac{t}{y}\right) \]
      14. metadata-eval99.7%

        \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 94.1%

      \[\leadsto x + \frac{-0.3333333333333333}{z} \cdot \color{blue}{y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification94.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.9:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq 6:\\ \;\;\;\;x + \frac{\frac{t \cdot 0.3333333333333333}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 94.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq 3.6 \cdot 10^{+210}:\\ \;\;\;\;x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{z \cdot y}}{3}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z 3.0) 3.6e+210)
   (+ x (* (- y (/ t y)) (/ -0.3333333333333333 z)))
   (+ x (/ (/ t (* z y)) 3.0))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * 3.0) <= 3.6e+210) {
		tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z));
	} else {
		tmp = x + ((t / (z * y)) / 3.0);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z * 3.0d0) <= 3.6d+210) then
        tmp = x + ((y - (t / y)) * ((-0.3333333333333333d0) / z))
    else
        tmp = x + ((t / (z * y)) / 3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * 3.0) <= 3.6e+210) {
		tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z));
	} else {
		tmp = x + ((t / (z * y)) / 3.0);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z * 3.0) <= 3.6e+210:
		tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z))
	else:
		tmp = x + ((t / (z * y)) / 3.0)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * 3.0) <= 3.6e+210)
		tmp = Float64(x + Float64(Float64(y - Float64(t / y)) * Float64(-0.3333333333333333 / z)));
	else
		tmp = Float64(x + Float64(Float64(t / Float64(z * y)) / 3.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z * 3.0) <= 3.6e+210)
		tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z));
	else
		tmp = x + ((t / (z * y)) / 3.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 3.6e+210], N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 3.6 \cdot 10^{+210}:\\
\;\;\;\;x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot y}}{3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 3) < 3.6000000000000003e210

    1. Initial program 94.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg94.5%

        \[\leadsto \color{blue}{\left(x + \left(-\frac{y}{z \cdot 3}\right)\right)} + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. associate-+l+94.5%

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. remove-double-neg94.5%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)}\right) \]
      4. distribute-frac-neg94.5%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right)\right) \]
      5. unsub-neg94.5%

        \[\leadsto x + \color{blue}{\left(\left(-\frac{y}{z \cdot 3}\right) - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      6. neg-mul-194.5%

        \[\leadsto x + \left(\color{blue}{-1 \cdot \frac{y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. associate-*r/94.5%

        \[\leadsto x + \left(\color{blue}{\frac{-1 \cdot y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      8. associate-*l/94.4%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{z \cdot 3} \cdot y} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. neg-mul-194.4%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. times-frac96.4%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}}\right) \]
      11. distribute-lft-out--97.7%

        \[\leadsto x + \color{blue}{\frac{-1}{z \cdot 3} \cdot \left(y - \frac{t}{y}\right)} \]
      12. *-commutative97.7%

        \[\leadsto x + \frac{-1}{\color{blue}{3 \cdot z}} \cdot \left(y - \frac{t}{y}\right) \]
      13. associate-/r*97.7%

        \[\leadsto x + \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot \left(y - \frac{t}{y}\right) \]
      14. metadata-eval97.7%

        \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
    3. Simplified97.7%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)} \]
    4. Add Preprocessing

    if 3.6000000000000003e210 < (*.f64 z 3)

    1. Initial program 99.8%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    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. remove-double-neg99.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)}\right) \]
      4. distribute-frac-neg99.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right)\right) \]
      5. unsub-neg99.8%

        \[\leadsto x + \color{blue}{\left(\left(-\frac{y}{z \cdot 3}\right) - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      6. neg-mul-199.8%

        \[\leadsto x + \left(\color{blue}{-1 \cdot \frac{y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. associate-*r/99.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1 \cdot y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      8. associate-*l/99.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{z \cdot 3} \cdot y} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. neg-mul-199.8%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. times-frac73.8%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}}\right) \]
      11. distribute-lft-out--73.8%

        \[\leadsto x + \color{blue}{\frac{-1}{z \cdot 3} \cdot \left(y - \frac{t}{y}\right)} \]
      12. *-commutative73.8%

        \[\leadsto x + \frac{-1}{\color{blue}{3 \cdot z}} \cdot \left(y - \frac{t}{y}\right) \]
      13. associate-/r*73.8%

        \[\leadsto x + \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot \left(y - \frac{t}{y}\right) \]
      14. metadata-eval73.8%

        \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
    3. Simplified73.8%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 92.7%

      \[\leadsto \color{blue}{x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}} \]
    6. Step-by-step derivation
      1. +-commutative92.7%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z} + x} \]
    7. Simplified92.7%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z} + x} \]
    8. Step-by-step derivation
      1. metadata-eval92.7%

        \[\leadsto \color{blue}{\frac{1}{3}} \cdot \frac{t}{y \cdot z} + x \]
      2. associate-/r*66.7%

        \[\leadsto \frac{1}{3} \cdot \color{blue}{\frac{\frac{t}{y}}{z}} + x \]
      3. times-frac66.6%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{t}{y}}{3 \cdot z}} + x \]
      4. *-un-lft-identity66.6%

        \[\leadsto \frac{\color{blue}{\frac{t}{y}}}{3 \cdot z} + x \]
      5. *-commutative66.6%

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{z \cdot 3}} + x \]
      6. associate-/r*66.7%

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y}}{z}}{3}} + x \]
      7. associate-/r*92.8%

        \[\leadsto \frac{\color{blue}{\frac{t}{y \cdot z}}}{3} + x \]
    9. Applied egg-rr92.8%

      \[\leadsto \color{blue}{\frac{\frac{t}{y \cdot z}}{3}} + x \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq 3.6 \cdot 10^{+210}:\\ \;\;\;\;x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{z \cdot y}}{3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 95.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq 3.6 \cdot 10^{+210}:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{z \cdot y}}{3}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z 3.0) 3.6e+210)
   (+ x (/ (- (/ t y) y) (* z 3.0)))
   (+ x (/ (/ t (* z y)) 3.0))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * 3.0) <= 3.6e+210) {
		tmp = x + (((t / y) - y) / (z * 3.0));
	} else {
		tmp = x + ((t / (z * y)) / 3.0);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z * 3.0d0) <= 3.6d+210) then
        tmp = x + (((t / y) - y) / (z * 3.0d0))
    else
        tmp = x + ((t / (z * y)) / 3.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * 3.0) <= 3.6e+210) {
		tmp = x + (((t / y) - y) / (z * 3.0));
	} else {
		tmp = x + ((t / (z * y)) / 3.0);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z * 3.0) <= 3.6e+210:
		tmp = x + (((t / y) - y) / (z * 3.0))
	else:
		tmp = x + ((t / (z * y)) / 3.0)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * 3.0) <= 3.6e+210)
		tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0)));
	else
		tmp = Float64(x + Float64(Float64(t / Float64(z * y)) / 3.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z * 3.0) <= 3.6e+210)
		tmp = x + (((t / y) - y) / (z * 3.0));
	else
		tmp = x + ((t / (z * y)) / 3.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], 3.6e+210], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 3.6 \cdot 10^{+210}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\

\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot y}}{3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 3) < 3.6000000000000003e210

    1. Initial program 94.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*94.5%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative94.5%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified94.5%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative94.5%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(3 \cdot y\right)}} \]
      2. associate-*l*94.5%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      3. associate-+l-94.5%

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      4. *-commutative94.5%

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      5. associate-/r*96.5%

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      6. sub-div97.8%

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
    6. Applied egg-rr97.8%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]

    if 3.6000000000000003e210 < (*.f64 z 3)

    1. Initial program 99.8%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    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. remove-double-neg99.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)}\right) \]
      4. distribute-frac-neg99.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right)\right) \]
      5. unsub-neg99.8%

        \[\leadsto x + \color{blue}{\left(\left(-\frac{y}{z \cdot 3}\right) - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      6. neg-mul-199.8%

        \[\leadsto x + \left(\color{blue}{-1 \cdot \frac{y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. associate-*r/99.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1 \cdot y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      8. associate-*l/99.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{z \cdot 3} \cdot y} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. neg-mul-199.8%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. times-frac73.8%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}}\right) \]
      11. distribute-lft-out--73.8%

        \[\leadsto x + \color{blue}{\frac{-1}{z \cdot 3} \cdot \left(y - \frac{t}{y}\right)} \]
      12. *-commutative73.8%

        \[\leadsto x + \frac{-1}{\color{blue}{3 \cdot z}} \cdot \left(y - \frac{t}{y}\right) \]
      13. associate-/r*73.8%

        \[\leadsto x + \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot \left(y - \frac{t}{y}\right) \]
      14. metadata-eval73.8%

        \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
    3. Simplified73.8%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 92.7%

      \[\leadsto \color{blue}{x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}} \]
    6. Step-by-step derivation
      1. +-commutative92.7%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z} + x} \]
    7. Simplified92.7%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z} + x} \]
    8. Step-by-step derivation
      1. metadata-eval92.7%

        \[\leadsto \color{blue}{\frac{1}{3}} \cdot \frac{t}{y \cdot z} + x \]
      2. associate-/r*66.7%

        \[\leadsto \frac{1}{3} \cdot \color{blue}{\frac{\frac{t}{y}}{z}} + x \]
      3. times-frac66.6%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{t}{y}}{3 \cdot z}} + x \]
      4. *-un-lft-identity66.6%

        \[\leadsto \frac{\color{blue}{\frac{t}{y}}}{3 \cdot z} + x \]
      5. *-commutative66.6%

        \[\leadsto \frac{\frac{t}{y}}{\color{blue}{z \cdot 3}} + x \]
      6. associate-/r*66.7%

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y}}{z}}{3}} + x \]
      7. associate-/r*92.8%

        \[\leadsto \frac{\color{blue}{\frac{t}{y \cdot z}}}{3} + x \]
    9. Applied egg-rr92.8%

      \[\leadsto \color{blue}{\frac{\frac{t}{y \cdot z}}{3}} + x \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq 3.6 \cdot 10^{+210}:\\ \;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\frac{t}{z \cdot y}}{3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 47.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+17}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -2.7e+20) x (if (<= z 1.8e+17) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -2.7e+20) {
		tmp = x;
	} else if (z <= 1.8e+17) {
		tmp = -0.3333333333333333 * (y / z);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-2.7d+20)) then
        tmp = x
    else if (z <= 1.8d+17) then
        tmp = (-0.3333333333333333d0) * (y / z)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -2.7e+20) {
		tmp = x;
	} else if (z <= 1.8e+17) {
		tmp = -0.3333333333333333 * (y / z);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -2.7e+20:
		tmp = x
	elif z <= 1.8e+17:
		tmp = -0.3333333333333333 * (y / z)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -2.7e+20)
		tmp = x;
	elseif (z <= 1.8e+17)
		tmp = Float64(-0.3333333333333333 * Float64(y / z));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -2.7e+20)
		tmp = x;
	elseif (z <= 1.8e+17)
		tmp = -0.3333333333333333 * (y / z);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.7e+20], x, If[LessEqual[z, 1.8e+17], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+20}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{+17}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.7e20 or 1.8e17 < z

    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. remove-double-neg99.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)}\right) \]
      4. distribute-frac-neg99.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right)\right) \]
      5. unsub-neg99.8%

        \[\leadsto x + \color{blue}{\left(\left(-\frac{y}{z \cdot 3}\right) - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      6. neg-mul-199.8%

        \[\leadsto x + \left(\color{blue}{-1 \cdot \frac{y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. associate-*r/99.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1 \cdot y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      8. associate-*l/99.7%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{z \cdot 3} \cdot y} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. neg-mul-199.7%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. times-frac90.6%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}}\right) \]
      11. distribute-lft-out--90.6%

        \[\leadsto x + \color{blue}{\frac{-1}{z \cdot 3} \cdot \left(y - \frac{t}{y}\right)} \]
      12. *-commutative90.6%

        \[\leadsto x + \frac{-1}{\color{blue}{3 \cdot z}} \cdot \left(y - \frac{t}{y}\right) \]
      13. associate-/r*90.6%

        \[\leadsto x + \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot \left(y - \frac{t}{y}\right) \]
      14. metadata-eval90.6%

        \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
    3. Simplified90.6%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 53.4%

      \[\leadsto \color{blue}{x} \]

    if -2.7e20 < z < 1.8e17

    1. Initial program 91.1%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified91.1%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(3 \cdot y\right)}} \]
      2. associate-*l*91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      3. associate-+l-91.1%

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      4. *-commutative91.1%

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      5. associate-/r*97.7%

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      6. sub-div99.8%

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around inf 46.3%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+17}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 47.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+16}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -3.7e+20) x (if (<= z 9e+16) (/ y (* z -3.0)) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.7e+20) {
		tmp = x;
	} else if (z <= 9e+16) {
		tmp = y / (z * -3.0);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-3.7d+20)) then
        tmp = x
    else if (z <= 9d+16) then
        tmp = y / (z * (-3.0d0))
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.7e+20) {
		tmp = x;
	} else if (z <= 9e+16) {
		tmp = y / (z * -3.0);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -3.7e+20:
		tmp = x
	elif z <= 9e+16:
		tmp = y / (z * -3.0)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -3.7e+20)
		tmp = x;
	elseif (z <= 9e+16)
		tmp = Float64(y / Float64(z * -3.0));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -3.7e+20)
		tmp = x;
	elseif (z <= 9e+16)
		tmp = y / (z * -3.0);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e+20], x, If[LessEqual[z, 9e+16], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+20}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 9 \cdot 10^{+16}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.7e20 or 9e16 < z

    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. remove-double-neg99.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)}\right) \]
      4. distribute-frac-neg99.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right)\right) \]
      5. unsub-neg99.8%

        \[\leadsto x + \color{blue}{\left(\left(-\frac{y}{z \cdot 3}\right) - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      6. neg-mul-199.8%

        \[\leadsto x + \left(\color{blue}{-1 \cdot \frac{y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. associate-*r/99.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1 \cdot y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      8. associate-*l/99.7%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{z \cdot 3} \cdot y} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. neg-mul-199.7%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. times-frac90.6%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}}\right) \]
      11. distribute-lft-out--90.6%

        \[\leadsto x + \color{blue}{\frac{-1}{z \cdot 3} \cdot \left(y - \frac{t}{y}\right)} \]
      12. *-commutative90.6%

        \[\leadsto x + \frac{-1}{\color{blue}{3 \cdot z}} \cdot \left(y - \frac{t}{y}\right) \]
      13. associate-/r*90.6%

        \[\leadsto x + \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot \left(y - \frac{t}{y}\right) \]
      14. metadata-eval90.6%

        \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
    3. Simplified90.6%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 53.4%

      \[\leadsto \color{blue}{x} \]

    if -3.7e20 < z < 9e16

    1. Initial program 91.1%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified91.1%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(3 \cdot y\right)}} \]
      2. associate-*l*91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      3. associate-+l-91.1%

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      4. *-commutative91.1%

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      5. associate-/r*97.7%

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      6. sub-div99.8%

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around inf 46.3%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
    8. Step-by-step derivation
      1. *-commutative46.3%

        \[\leadsto \color{blue}{\frac{y}{z} \cdot -0.3333333333333333} \]
      2. associate-/r/46.3%

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
      3. div-inv46.3%

        \[\leadsto \frac{y}{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}} \]
      4. metadata-eval46.3%

        \[\leadsto \frac{y}{z \cdot \color{blue}{-3}} \]
    9. Applied egg-rr46.3%

      \[\leadsto \color{blue}{\frac{y}{z \cdot -3}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+16}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 47.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 42000000000000:\\ \;\;\;\;\frac{\frac{y}{z}}{-3}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -3.7e+20) x (if (<= z 42000000000000.0) (/ (/ y z) -3.0) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.7e+20) {
		tmp = x;
	} else if (z <= 42000000000000.0) {
		tmp = (y / z) / -3.0;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-3.7d+20)) then
        tmp = x
    else if (z <= 42000000000000.0d0) then
        tmp = (y / z) / (-3.0d0)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -3.7e+20) {
		tmp = x;
	} else if (z <= 42000000000000.0) {
		tmp = (y / z) / -3.0;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -3.7e+20:
		tmp = x
	elif z <= 42000000000000.0:
		tmp = (y / z) / -3.0
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -3.7e+20)
		tmp = x;
	elseif (z <= 42000000000000.0)
		tmp = Float64(Float64(y / z) / -3.0);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -3.7e+20)
		tmp = x;
	elseif (z <= 42000000000000.0)
		tmp = (y / z) / -3.0;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e+20], x, If[LessEqual[z, 42000000000000.0], N[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+20}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 42000000000000:\\
\;\;\;\;\frac{\frac{y}{z}}{-3}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.7e20 or 4.2e13 < z

    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. remove-double-neg99.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)}\right) \]
      4. distribute-frac-neg99.8%

        \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right)\right) \]
      5. unsub-neg99.8%

        \[\leadsto x + \color{blue}{\left(\left(-\frac{y}{z \cdot 3}\right) - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      6. neg-mul-199.8%

        \[\leadsto x + \left(\color{blue}{-1 \cdot \frac{y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. associate-*r/99.8%

        \[\leadsto x + \left(\color{blue}{\frac{-1 \cdot y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      8. associate-*l/99.7%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{z \cdot 3} \cdot y} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. neg-mul-199.7%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. times-frac90.6%

        \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}}\right) \]
      11. distribute-lft-out--90.6%

        \[\leadsto x + \color{blue}{\frac{-1}{z \cdot 3} \cdot \left(y - \frac{t}{y}\right)} \]
      12. *-commutative90.6%

        \[\leadsto x + \frac{-1}{\color{blue}{3 \cdot z}} \cdot \left(y - \frac{t}{y}\right) \]
      13. associate-/r*90.6%

        \[\leadsto x + \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot \left(y - \frac{t}{y}\right) \]
      14. metadata-eval90.6%

        \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
    3. Simplified90.6%

      \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 53.4%

      \[\leadsto \color{blue}{x} \]

    if -3.7e20 < z < 4.2e13

    1. Initial program 91.1%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified91.1%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(3 \cdot y\right)}} \]
      2. associate-*l*91.1%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
      3. associate-+l-91.1%

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      4. *-commutative91.1%

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      5. associate-/r*97.7%

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
      6. sub-div99.8%

        \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    7. Taylor expanded in y around inf 46.3%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
    8. Step-by-step derivation
      1. associate-*r/46.3%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative46.3%

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
      3. clear-num46.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{y \cdot -0.3333333333333333}}} \]
      4. reciprocal-define32.9%

        \[\leadsto \color{blue}{\mathsf{reciprocal}\left(\left(\frac{z}{y \cdot -0.3333333333333333}\right)\right)} \]
      5. *-commutative32.9%

        \[\leadsto \mathsf{reciprocal}\left(\left(\frac{z}{\color{blue}{-0.3333333333333333 \cdot y}}\right)\right) \]
      6. associate-/r*32.9%

        \[\leadsto \mathsf{reciprocal}\left(\color{blue}{\left(\frac{\frac{z}{-0.3333333333333333}}{y}\right)}\right) \]
      7. div-inv32.9%

        \[\leadsto \mathsf{reciprocal}\left(\left(\frac{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}}{y}\right)\right) \]
      8. metadata-eval32.9%

        \[\leadsto \mathsf{reciprocal}\left(\left(\frac{z \cdot \color{blue}{-3}}{y}\right)\right) \]
    9. Applied egg-rr32.9%

      \[\leadsto \color{blue}{\mathsf{reciprocal}\left(\left(\frac{z \cdot -3}{y}\right)\right)} \]
    10. Step-by-step derivation
      1. reciprocal-undefine46.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot -3}{y}}} \]
      2. clear-num46.3%

        \[\leadsto \color{blue}{\frac{y}{z \cdot -3}} \]
      3. associate-/r*46.4%

        \[\leadsto \color{blue}{\frac{\frac{y}{z}}{-3}} \]
    11. Applied egg-rr46.4%

      \[\leadsto \color{blue}{\frac{\frac{y}{z}}{-3}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 42000000000000:\\ \;\;\;\;\frac{\frac{y}{z}}{-3}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 29.9% accurate, 15.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 94.9%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Step-by-step derivation
    1. sub-neg94.9%

      \[\leadsto \color{blue}{\left(x + \left(-\frac{y}{z \cdot 3}\right)\right)} + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. associate-+l+94.9%

      \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    3. remove-double-neg94.9%

      \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)}\right) \]
    4. distribute-frac-neg94.9%

      \[\leadsto x + \left(\left(-\frac{y}{z \cdot 3}\right) + \left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right)\right) \]
    5. unsub-neg94.9%

      \[\leadsto x + \color{blue}{\left(\left(-\frac{y}{z \cdot 3}\right) - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    6. neg-mul-194.9%

      \[\leadsto x + \left(\color{blue}{-1 \cdot \frac{y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
    7. associate-*r/94.9%

      \[\leadsto x + \left(\color{blue}{\frac{-1 \cdot y}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
    8. associate-*l/94.9%

      \[\leadsto x + \left(\color{blue}{\frac{-1}{z \cdot 3} \cdot y} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
    9. neg-mul-194.9%

      \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y}\right) \]
    10. times-frac94.5%

      \[\leadsto x + \left(\frac{-1}{z \cdot 3} \cdot y - \color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}}\right) \]
    11. distribute-lft-out--95.7%

      \[\leadsto x + \color{blue}{\frac{-1}{z \cdot 3} \cdot \left(y - \frac{t}{y}\right)} \]
    12. *-commutative95.7%

      \[\leadsto x + \frac{-1}{\color{blue}{3 \cdot z}} \cdot \left(y - \frac{t}{y}\right) \]
    13. associate-/r*95.7%

      \[\leadsto x + \color{blue}{\frac{\frac{-1}{3}}{z}} \cdot \left(y - \frac{t}{y}\right) \]
    14. metadata-eval95.7%

      \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
  3. Simplified95.7%

    \[\leadsto \color{blue}{x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 28.3%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification28.3%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 95.7% 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 2024024 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

  :herbie-target
  (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))

  (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))