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

Percentage Accurate: 96.0% → 97.6%
Time: 11.4s
Alternatives: 17
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 96.0% 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.6% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z #s(literal 3 binary64)) < -1.00000000000000002e116

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000002e116 < (*.f64 z #s(literal 3 binary64))

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 61.8% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.6 \cdot 10^{+18}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{y}{z}\\

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


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

    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. distribute-frac-neg96.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{-0.3333333333333333}}} \]
      2. div-inv59.7%

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

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

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

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

    if -150 < y < 1.5999999999999999e-80

    1. Initial program 92.5%

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

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

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

    if 1.5999999999999999e-80 < y < 1.6e18

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6e18 < y

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{-0.3333333333333333}}} \]
      2. div-inv69.5%

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

        \[\leadsto y \cdot \frac{1}{z \cdot \color{blue}{-3}} \]
      4. div-inv69.5%

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

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

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

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

Alternative 3: 92.2% accurate, 0.7× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{-\frac{z}{0.3333333333333333}}} \]
      10. neg-mul-131.1%

        \[\leadsto x + \frac{\color{blue}{-y}}{-\frac{z}{0.3333333333333333}} \]
      11. add-sqr-sqrt31.1%

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

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

        \[\leadsto x + \frac{\sqrt{\color{blue}{y \cdot y}}}{-\frac{z}{0.3333333333333333}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\frac{z}{0.3333333333333333}} \]
      15. add-sqr-sqrt87.7%

        \[\leadsto x + \frac{\color{blue}{y}}{-\frac{z}{0.3333333333333333}} \]
      16. div-inv87.7%

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

        \[\leadsto x + \frac{y}{-z \cdot \color{blue}{3}} \]
      18. distribute-rgt-neg-in87.7%

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

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

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

    if -32000 < y < 2.89999999999999981e-10

    1. Initial program 93.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-neg93.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+93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.89999999999999981e-10 < y

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 61.6% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.75 \cdot 10^{-5}:\\
\;\;\;\;x\\

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


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

    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. distribute-frac-neg96.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{-0.3333333333333333}}} \]
      2. div-inv59.7%

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

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

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

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

    if -3.60000000000000009 < y < 6.2000000000000005e-85

    1. Initial program 92.5%

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

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

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

    if 6.2000000000000005e-85 < y < 1.7499999999999998e-5

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7499999999999998e-5 < y

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z}{-0.3333333333333333}}} \]
      2. div-inv67.0%

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

        \[\leadsto y \cdot \frac{1}{z \cdot \color{blue}{-3}} \]
      4. div-inv67.0%

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

        \[\leadsto \color{blue}{\frac{\frac{y}{z}}{-3}} \]
    8. Applied egg-rr68.5%

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

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

Alternative 5: 92.3% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 2.9 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{\frac{t}{z}}{3 \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 < -460

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{-\frac{z}{0.3333333333333333}}} \]
      10. neg-mul-131.1%

        \[\leadsto x + \frac{\color{blue}{-y}}{-\frac{z}{0.3333333333333333}} \]
      11. add-sqr-sqrt31.1%

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

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

        \[\leadsto x + \frac{\sqrt{\color{blue}{y \cdot y}}}{-\frac{z}{0.3333333333333333}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\frac{z}{0.3333333333333333}} \]
      15. add-sqr-sqrt87.7%

        \[\leadsto x + \frac{\color{blue}{y}}{-\frac{z}{0.3333333333333333}} \]
      16. div-inv87.7%

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

        \[\leadsto x + \frac{y}{-z \cdot \color{blue}{3}} \]
      18. distribute-rgt-neg-in87.7%

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

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

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

    if -460 < y < 2.89999999999999981e-10

    1. Initial program 93.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-neg93.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+93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.89999999999999981e-10 < y

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 89.1% accurate, 0.8× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{-\frac{z}{0.3333333333333333}}} \]
      10. neg-mul-131.1%

        \[\leadsto x + \frac{\color{blue}{-y}}{-\frac{z}{0.3333333333333333}} \]
      11. add-sqr-sqrt31.1%

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

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

        \[\leadsto x + \frac{\sqrt{\color{blue}{y \cdot y}}}{-\frac{z}{0.3333333333333333}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\frac{z}{0.3333333333333333}} \]
      15. add-sqr-sqrt87.7%

        \[\leadsto x + \frac{\color{blue}{y}}{-\frac{z}{0.3333333333333333}} \]
      16. div-inv87.7%

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

        \[\leadsto x + \frac{y}{-z \cdot \color{blue}{3}} \]
      18. distribute-rgt-neg-in87.7%

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

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

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

    if -115 < y < 3.6999999999999999e76

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6999999999999999e76 < y

    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. +-commutative97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 89.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -200:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{+76}:\\ \;\;\;\;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 -200.0)
   (+ x (/ y (* z -3.0)))
   (if (<= y 3.7e+76)
     (+ 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 <= -200.0) {
		tmp = x + (y / (z * -3.0));
	} else if (y <= 3.7e+76) {
		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 <= (-200.0d0)) then
        tmp = x + (y / (z * (-3.0d0)))
    else if (y <= 3.7d+76) 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 <= -200.0) {
		tmp = x + (y / (z * -3.0));
	} else if (y <= 3.7e+76) {
		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 <= -200.0:
		tmp = x + (y / (z * -3.0))
	elif y <= 3.7e+76:
		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 <= -200.0)
		tmp = Float64(x + Float64(y / Float64(z * -3.0)));
	elseif (y <= 3.7e+76)
		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 <= -200.0)
		tmp = x + (y / (z * -3.0));
	elseif (y <= 3.7e+76)
		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, -200.0], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e+76], 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 -200:\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\

\mathbf{elif}\;y \leq 3.7 \cdot 10^{+76}:\\
\;\;\;\;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 < -200

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{-\frac{z}{0.3333333333333333}}} \]
      10. neg-mul-131.1%

        \[\leadsto x + \frac{\color{blue}{-y}}{-\frac{z}{0.3333333333333333}} \]
      11. add-sqr-sqrt31.1%

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

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

        \[\leadsto x + \frac{\sqrt{\color{blue}{y \cdot y}}}{-\frac{z}{0.3333333333333333}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\frac{z}{0.3333333333333333}} \]
      15. add-sqr-sqrt87.7%

        \[\leadsto x + \frac{\color{blue}{y}}{-\frac{z}{0.3333333333333333}} \]
      16. div-inv87.7%

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

        \[\leadsto x + \frac{y}{-z \cdot \color{blue}{3}} \]
      18. distribute-rgt-neg-in87.7%

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

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

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

    if -200 < y < 3.6999999999999999e76

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6999999999999999e76 < y

    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. +-commutative97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 77.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-74} \lor \neg \left(y \leq 1.35 \cdot 10^{-80}\right):\\
\;\;\;\;x + \frac{y}{z \cdot -3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.70000000000000018e-74 or 1.3500000000000001e-80 < y

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{-\frac{z}{0.3333333333333333}}} \]
      10. neg-mul-134.2%

        \[\leadsto x + \frac{\color{blue}{-y}}{-\frac{z}{0.3333333333333333}} \]
      11. add-sqr-sqrt16.8%

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

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

        \[\leadsto x + \frac{\sqrt{\color{blue}{y \cdot y}}}{-\frac{z}{0.3333333333333333}} \]
      14. sqrt-unprod45.8%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\frac{z}{0.3333333333333333}} \]
      15. add-sqr-sqrt84.5%

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

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

        \[\leadsto x + \frac{y}{-z \cdot \color{blue}{3}} \]
      18. distribute-rgt-neg-in84.6%

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

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

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

    if -2.70000000000000018e-74 < y < 1.3500000000000001e-80

    1. Initial program 91.6%

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

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

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

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

Alternative 9: 79.1% accurate, 0.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{-\frac{z}{0.3333333333333333}}} \]
      10. neg-mul-136.8%

        \[\leadsto x + \frac{\color{blue}{-y}}{-\frac{z}{0.3333333333333333}} \]
      11. add-sqr-sqrt36.8%

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

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

        \[\leadsto x + \frac{\sqrt{\color{blue}{y \cdot y}}}{-\frac{z}{0.3333333333333333}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\frac{z}{0.3333333333333333}} \]
      15. add-sqr-sqrt84.5%

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

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

        \[\leadsto x + \frac{y}{-z \cdot \color{blue}{3}} \]
      18. distribute-rgt-neg-in84.6%

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

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

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

    if -1.75000000000000007e-74 < y < 1.00000000000000002e-91

    1. Initial program 91.6%

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

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

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

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

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

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

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

    if 1.00000000000000002e-91 < y

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 79.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{-74}:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-81}:\\ \;\;\;\;\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 -1.2e-74)
   (+ x (/ y (* z -3.0)))
   (if (<= y 1.3e-81)
     (/ (/ (* 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.2e-74) {
		tmp = x + (y / (z * -3.0));
	} else if (y <= 1.3e-81) {
		tmp = ((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.2d-74)) then
        tmp = x + (y / (z * (-3.0d0)))
    else if (y <= 1.3d-81) then
        tmp = ((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.2e-74) {
		tmp = x + (y / (z * -3.0));
	} else if (y <= 1.3e-81) {
		tmp = ((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.2e-74:
		tmp = x + (y / (z * -3.0))
	elif y <= 1.3e-81:
		tmp = ((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.2e-74)
		tmp = Float64(x + Float64(y / Float64(z * -3.0)));
	elseif (y <= 1.3e-81)
		tmp = 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 <= -1.2e-74)
		tmp = x + (y / (z * -3.0));
	elseif (y <= 1.3e-81)
		tmp = ((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.2e-74], N[(x + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-81], N[(N[(N[(t * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision], N[(x - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-81}:\\
\;\;\;\;\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 < -1.1999999999999999e-74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{-\frac{z}{0.3333333333333333}}} \]
      10. neg-mul-136.8%

        \[\leadsto x + \frac{\color{blue}{-y}}{-\frac{z}{0.3333333333333333}} \]
      11. add-sqr-sqrt36.8%

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

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

        \[\leadsto x + \frac{\sqrt{\color{blue}{y \cdot y}}}{-\frac{z}{0.3333333333333333}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\frac{z}{0.3333333333333333}} \]
      15. add-sqr-sqrt84.5%

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

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

        \[\leadsto x + \frac{y}{-z \cdot \color{blue}{3}} \]
      18. distribute-rgt-neg-in84.6%

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

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

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

    if -1.1999999999999999e-74 < y < 1.2999999999999999e-81

    1. Initial program 91.6%

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

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

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

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

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

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

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

    if 1.2999999999999999e-81 < y

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 79.1% accurate, 0.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{-\frac{z}{0.3333333333333333}}} \]
      10. neg-mul-136.8%

        \[\leadsto x + \frac{\color{blue}{-y}}{-\frac{z}{0.3333333333333333}} \]
      11. add-sqr-sqrt36.8%

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

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

        \[\leadsto x + \frac{\sqrt{\color{blue}{y \cdot y}}}{-\frac{z}{0.3333333333333333}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\frac{z}{0.3333333333333333}} \]
      15. add-sqr-sqrt84.5%

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

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

        \[\leadsto x + \frac{y}{-z \cdot \color{blue}{3}} \]
      18. distribute-rgt-neg-in84.6%

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

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

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

    if -2.70000000000000018e-74 < y < 1.99999999999999998e-92

    1. Initial program 91.6%

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

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

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

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

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

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

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

    if 1.99999999999999998e-92 < y

    1. Initial program 98.7%

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

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

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

Alternative 12: 77.4% accurate, 0.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{-\frac{z}{0.3333333333333333}}} \]
      10. neg-mul-136.8%

        \[\leadsto x + \frac{\color{blue}{-y}}{-\frac{z}{0.3333333333333333}} \]
      11. add-sqr-sqrt36.8%

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

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

        \[\leadsto x + \frac{\sqrt{\color{blue}{y \cdot y}}}{-\frac{z}{0.3333333333333333}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\frac{z}{0.3333333333333333}} \]
      15. add-sqr-sqrt84.5%

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

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

        \[\leadsto x + \frac{y}{-z \cdot \color{blue}{3}} \]
      18. distribute-rgt-neg-in84.6%

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

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

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

    if -2.2000000000000001e-74 < y < 3.3e-87

    1. Initial program 91.6%

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

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

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

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

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

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

    if 3.3e-87 < y

    1. Initial program 98.7%

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

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

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

Alternative 13: 77.4% accurate, 0.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{-\frac{z}{0.3333333333333333}}} \]
      10. neg-mul-136.8%

        \[\leadsto x + \frac{\color{blue}{-y}}{-\frac{z}{0.3333333333333333}} \]
      11. add-sqr-sqrt36.8%

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

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

        \[\leadsto x + \frac{\sqrt{\color{blue}{y \cdot y}}}{-\frac{z}{0.3333333333333333}} \]
      14. sqrt-unprod0.0%

        \[\leadsto x + \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-\frac{z}{0.3333333333333333}} \]
      15. add-sqr-sqrt84.5%

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

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

        \[\leadsto x + \frac{y}{-z \cdot \color{blue}{3}} \]
      18. distribute-rgt-neg-in84.6%

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

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

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

    if -1.5999999999999999e-74 < y < 7.2e-95

    1. Initial program 91.6%

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

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

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

    if 7.2e-95 < y

    1. Initial program 98.7%

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

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

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

Alternative 14: 48.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+54}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 4.2 \cdot 10^{+25}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1999999999999999e54 or 4.1999999999999998e25 < x

    1. Initial program 95.4%

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

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

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

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

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

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

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define95.4%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. metadata-eval95.4%

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*95.3%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative95.3%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified95.3%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 56.8%

      \[\leadsto \color{blue}{x} \]

    if -2.1999999999999999e54 < x < 4.1999999999999998e25

    1. Initial program 96.0%

      \[\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.0%

        \[\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.0%

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. distribute-frac-neg96.0%

        \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      4. neg-mul-196.0%

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative96.0%

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac95.9%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define95.9%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. metadata-eval95.9%

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*95.9%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative95.9%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified95.9%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 60.1%

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - 0.3333333333333333 \cdot \frac{1}{z}\right)} \]
    6. Taylor expanded in x around 0 48.1%

      \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
    7. Step-by-step derivation
      1. associate-*r/48.1%

        \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    8. Applied egg-rr48.1%

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 48.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.9 \cdot 10^{+53}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 8.4 \cdot 10^{+27}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -5.9e+53) x (if (<= x 8.4e+27) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -5.9e+53) {
		tmp = x;
	} else if (x <= 8.4e+27) {
		tmp = y * (-0.3333333333333333 / z);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x <= (-5.9d+53)) then
        tmp = x
    else if (x <= 8.4d+27) then
        tmp = y * ((-0.3333333333333333d0) / z)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -5.9e+53) {
		tmp = x;
	} else if (x <= 8.4e+27) {
		tmp = y * (-0.3333333333333333 / z);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -5.9e+53:
		tmp = x
	elif x <= 8.4e+27:
		tmp = y * (-0.3333333333333333 / z)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -5.9e+53)
		tmp = x;
	elseif (x <= 8.4e+27)
		tmp = Float64(y * Float64(-0.3333333333333333 / z));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -5.9e+53)
		tmp = x;
	elseif (x <= 8.4e+27)
		tmp = y * (-0.3333333333333333 / z);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.9e+53], x, If[LessEqual[x, 8.4e+27], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.9 \cdot 10^{+53}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 8.4 \cdot 10^{+27}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.8999999999999997e53 or 8.39999999999999978e27 < x

    1. Initial program 95.4%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg95.4%

        \[\leadsto \color{blue}{\left(x + \left(-\frac{y}{z \cdot 3}\right)\right)} + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
      2. associate-+l+95.4%

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. distribute-frac-neg95.4%

        \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      4. neg-mul-195.4%

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative95.4%

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac95.4%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define95.4%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. metadata-eval95.4%

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*95.3%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative95.3%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified95.3%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around inf 56.8%

      \[\leadsto \color{blue}{x} \]

    if -5.8999999999999997e53 < x < 8.39999999999999978e27

    1. Initial program 96.0%

      \[\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.0%

        \[\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.0%

        \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      3. distribute-frac-neg96.0%

        \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      4. neg-mul-196.0%

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative96.0%

        \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      6. times-frac95.9%

        \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      7. fma-define95.9%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      8. metadata-eval95.9%

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*95.9%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
      10. *-commutative95.9%

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified95.9%

      \[\leadsto \color{blue}{x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 60.1%

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - 0.3333333333333333 \cdot \frac{1}{z}\right)} \]
    6. Taylor expanded in x around 0 48.1%

      \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 96.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y))))
double code(double x, double y, double z, double t) {
	return x + ((0.3333333333333333 / z) * ((t / y) - y));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((0.3333333333333333 / z) * ((t / y) - y));
}
def code(x, y, z, t):
	return x + ((0.3333333333333333 / z) * ((t / y) - y))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)
\end{array}
Derivation
  1. Initial program 95.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-neg95.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+95.7%

      \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    3. +-commutative95.7%

      \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
    4. remove-double-neg95.7%

      \[\leadsto x + \left(\color{blue}{\left(-\left(-\frac{t}{\left(z \cdot 3\right) \cdot y}\right)\right)} + \left(-\frac{y}{z \cdot 3}\right)\right) \]
    5. distribute-frac-neg95.7%

      \[\leadsto x + \left(\left(-\color{blue}{\frac{-t}{\left(z \cdot 3\right) \cdot y}}\right) + \left(-\frac{y}{z \cdot 3}\right)\right) \]
    6. distribute-neg-in95.7%

      \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
    7. remove-double-neg95.7%

      \[\leadsto x + \left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \color{blue}{\left(-\left(-\frac{y}{z \cdot 3}\right)\right)}\right)\right) \]
    8. sub-neg95.7%

      \[\leadsto x + \left(-\color{blue}{\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)}\right) \]
    9. neg-mul-195.7%

      \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
    10. times-frac96.1%

      \[\leadsto x + \left(-\left(\color{blue}{\frac{-1}{z \cdot 3} \cdot \frac{t}{y}} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
    11. distribute-frac-neg96.1%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
    12. neg-mul-196.1%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{-1 \cdot y}}{z \cdot 3}\right)\right) \]
    13. *-commutative96.1%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \frac{\color{blue}{y \cdot -1}}{z \cdot 3}\right)\right) \]
    14. associate-/l*96.0%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{y \cdot \frac{-1}{z \cdot 3}}\right)\right) \]
    15. *-commutative96.0%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-1}{z \cdot 3} \cdot y}\right)\right) \]
  3. Simplified96.8%

    \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
  4. Add Preprocessing
  5. Add Preprocessing

Alternative 17: 30.2% accurate, 15.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 95.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-neg95.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+95.7%

      \[\leadsto \color{blue}{x + \left(\left(-\frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    3. distribute-frac-neg95.7%

      \[\leadsto x + \left(\color{blue}{\frac{-y}{z \cdot 3}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    4. neg-mul-195.7%

      \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    5. *-commutative95.7%

      \[\leadsto x + \left(\frac{-1 \cdot y}{\color{blue}{3 \cdot z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    6. times-frac95.7%

      \[\leadsto x + \left(\color{blue}{\frac{-1}{3} \cdot \frac{y}{z}} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    7. fma-define95.7%

      \[\leadsto x + \color{blue}{\mathsf{fma}\left(\frac{-1}{3}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    8. metadata-eval95.7%

      \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
    9. associate-*l*95.7%

      \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}}\right) \]
    10. *-commutative95.7%

      \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
  3. Simplified95.7%

    \[\leadsto \color{blue}{x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 31.8%

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer Target 1: 96.1% 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 2024140 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))

  (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))