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

Percentage Accurate: 95.7% → 97.7%
Time: 9.8s
Alternatives: 18
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 95.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.7% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 93.2%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg93.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) \]
      10. sub-neg93.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) \]
      11. neg-mul-193.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) \]
      12. times-frac97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e7 < (*.f64 z #s(literal 3 binary64))

    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*98.0%

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

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

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

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

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

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

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

Alternative 2: 63.5% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-21}:\\
\;\;\;\;x\\

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


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

    1. Initial program 95.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity69.2%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    5. Applied egg-rr69.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around 0 60.8%

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

    if -1.3800000000000001e48 < y < 3.9999999999999999e-66

    1. Initial program 90.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 x around 0 69.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity73.2%

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around inf 66.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{y} \cdot \frac{t}{z}} \]
    10. Applied egg-rr67.4%

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

    if 3.9999999999999999e-66 < y < 1.30000000000000009e-21

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1.30000000000000009e-21 < y

    1. Initial program 98.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 x around 0 78.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity79.7%

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around 0 69.6%

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\sqrt{y \cdot y}}}{z} \]
      3. sqr-neg46.1%

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(-y\right)}}{z} \]
      6. distribute-rgt-neg-in1.7%

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{0.3333333333333333}}{z} \]
      10. metadata-eval1.7%

        \[\leadsto \frac{y \cdot \color{blue}{\frac{1}{3}}}{z} \]
      11. div-inv1.7%

        \[\leadsto \frac{\color{blue}{\frac{y}{3}}}{z} \]
      12. frac-2neg1.7%

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{-3}}{z} \]
      14. sqrt-unprod46.3%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-3}}{z} \]
      15. sqr-neg46.3%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{y \cdot y}}}{-3}}{z} \]
      16. sqrt-unprod69.4%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-3}}{z} \]
      17. add-sqr-sqrt69.7%

        \[\leadsto \frac{\frac{\color{blue}{y}}{-3}}{z} \]
      18. metadata-eval69.7%

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

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

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

Alternative 3: 61.5% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-21}:\\
\;\;\;\;x\\

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


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

    1. Initial program 95.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity69.2%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    5. Applied egg-rr69.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around 0 60.8%

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

    if -6.8000000000000006e48 < y < 3.0000000000000002e-66

    1. Initial program 90.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 x around 0 69.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity73.2%

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around inf 64.7%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{y} \cdot \frac{0.3333333333333333}{z}} \]
      4. *-rgt-identity66.1%

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

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

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

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

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

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

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

    if 3.0000000000000002e-66 < y < 1.30000000000000009e-21

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1.30000000000000009e-21 < y

    1. Initial program 98.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 x around 0 78.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity79.7%

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around 0 69.6%

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\sqrt{y \cdot y}}}{z} \]
      3. sqr-neg46.1%

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(-y\right)}}{z} \]
      6. distribute-rgt-neg-in1.7%

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{0.3333333333333333}}{z} \]
      10. metadata-eval1.7%

        \[\leadsto \frac{y \cdot \color{blue}{\frac{1}{3}}}{z} \]
      11. div-inv1.7%

        \[\leadsto \frac{\color{blue}{\frac{y}{3}}}{z} \]
      12. frac-2neg1.7%

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{-3}}{z} \]
      14. sqrt-unprod46.3%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-3}}{z} \]
      15. sqr-neg46.3%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{y \cdot y}}}{-3}}{z} \]
      16. sqrt-unprod69.4%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-3}}{z} \]
      17. add-sqr-sqrt69.7%

        \[\leadsto \frac{\frac{\color{blue}{y}}{-3}}{z} \]
      18. metadata-eval69.7%

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

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

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

Alternative 4: 87.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 95.3%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg95.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) \]
      10. sub-neg95.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) \]
      11. neg-mul-195.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) \]
      12. times-frac97.4%

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

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

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

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

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

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

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

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

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

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

    if -2.6000000000000002e50 < y < 5.70000000000000032e-58

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      12. times-frac92.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) \]
      13. distribute-frac-neg92.5%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-192.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) \]
      15. *-commutative92.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) \]
      16. associate-/l*92.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) \]
      17. *-commutative92.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. Simplified93.1%

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

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{t \cdot \frac{0.3333333333333333}{y}}}{z} \]
    9. Simplified86.5%

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

    if 5.70000000000000032e-58 < y

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      12. times-frac98.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) \]
      13. distribute-frac-neg98.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-198.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) \]
      15. *-commutative98.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) \]
      16. associate-/l*98.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) \]
      17. *-commutative98.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. Simplified99.7%

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

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

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

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

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

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

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

      \[\leadsto x + \frac{\color{blue}{-1 \cdot y}}{z \cdot 3} \]
    8. Step-by-step derivation
      1. neg-mul-188.8%

        \[\leadsto x + \frac{\color{blue}{-y}}{z \cdot 3} \]
    9. Simplified88.8%

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

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

Alternative 5: 88.7% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 95.3%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg95.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) \]
      10. sub-neg95.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) \]
      11. neg-mul-195.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) \]
      12. times-frac97.4%

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

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

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

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

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

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

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

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

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

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

    if -3.59999999999999986e50 < y < 5.70000000000000032e-58

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      12. times-frac92.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) \]
      13. distribute-frac-neg92.5%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-192.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) \]
      15. *-commutative92.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) \]
      16. associate-/l*92.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) \]
      17. *-commutative92.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. Simplified93.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 inf 86.4%

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

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

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

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

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

        \[\leadsto x + \frac{\frac{t}{y}}{\color{blue}{z \cdot 3}} \]
      6. associate-/l/86.5%

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

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

    if 5.70000000000000032e-58 < y

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      12. times-frac98.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) \]
      13. distribute-frac-neg98.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-198.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) \]
      15. *-commutative98.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) \]
      16. associate-/l*98.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) \]
      17. *-commutative98.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. Simplified99.7%

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

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

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

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

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

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

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

      \[\leadsto x + \frac{\color{blue}{-1 \cdot y}}{z \cdot 3} \]
    8. Step-by-step derivation
      1. neg-mul-188.8%

        \[\leadsto x + \frac{\color{blue}{-y}}{z \cdot 3} \]
    9. Simplified88.8%

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

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

Alternative 6: 88.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 95.3%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
      9. remove-double-neg95.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) \]
      10. sub-neg95.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) \]
      11. neg-mul-195.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) \]
      12. times-frac97.4%

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

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

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

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

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

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

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

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

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

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

    if -6.20000000000000006e50 < y < 5.49999999999999996e-58

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      12. times-frac92.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) \]
      13. distribute-frac-neg92.5%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-192.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) \]
      15. *-commutative92.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) \]
      16. associate-/l*92.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) \]
      17. *-commutative92.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. Simplified93.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 inf 86.4%

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

    if 5.49999999999999996e-58 < y

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      12. times-frac98.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) \]
      13. distribute-frac-neg98.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-198.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) \]
      15. *-commutative98.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) \]
      16. associate-/l*98.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) \]
      17. *-commutative98.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. Simplified99.7%

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

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

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

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

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

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

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

      \[\leadsto x + \frac{\color{blue}{-1 \cdot y}}{z \cdot 3} \]
    8. Step-by-step derivation
      1. neg-mul-188.8%

        \[\leadsto x + \frac{\color{blue}{-y}}{z \cdot 3} \]
    9. Simplified88.8%

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

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

Alternative 7: 79.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.80000000000000006e-62 or 3.7999999999999998e-66 < y

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      12. times-frac97.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) \]
      13. distribute-frac-neg97.2%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-197.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) \]
      15. *-commutative97.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) \]
      16. associate-/l*97.1%

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

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

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

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

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

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

    if -3.80000000000000006e-62 < y < 3.7999999999999998e-66

    1. Initial program 90.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 x around 0 70.3%

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

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

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

        \[\leadsto \frac{1}{3} \cdot \left(\color{blue}{\frac{\frac{t}{y}}{z}} - \frac{y}{z}\right) \]
      4. sub-div73.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity74.0%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    5. Applied egg-rr74.0%

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around inf 70.3%

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

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

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

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

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

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

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

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

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

Alternative 8: 79.3% accurate, 0.9× speedup?

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

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

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

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


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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. 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) \]
      7. 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) \]
      8. 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)} \]
      9. 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) \]
      10. 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) \]
      11. 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) \]
      12. times-frac95.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) \]
      13. distribute-frac-neg95.3%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-195.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) \]
      15. *-commutative95.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) \]
      16. associate-/l*95.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) \]
      17. *-commutative95.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. Simplified98.1%

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

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

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

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

    if -8.5999999999999993e-62 < y < 4.5999999999999999e-65

    1. Initial program 90.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 x around 0 70.3%

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

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

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

        \[\leadsto \frac{1}{3} \cdot \left(\color{blue}{\frac{\frac{t}{y}}{z}} - \frac{y}{z}\right) \]
      4. sub-div73.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity74.0%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    5. Applied egg-rr74.0%

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around inf 70.3%

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

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

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

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

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

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

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

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

    if 4.5999999999999999e-65 < y

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      12. times-frac98.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) \]
      13. distribute-frac-neg98.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-198.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) \]
      15. *-commutative98.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) \]
      16. associate-/l*98.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) \]
      17. *-commutative98.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. Simplified99.6%

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

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

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

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

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

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

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

      \[\leadsto x + \frac{\color{blue}{-1 \cdot y}}{z \cdot 3} \]
    8. Step-by-step derivation
      1. neg-mul-187.9%

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

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

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

Alternative 9: 79.3% accurate, 0.9× speedup?

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

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

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

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


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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + \left(-\frac{y}{z \cdot 3}\right)\right)} \]
      6. 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) \]
      7. 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) \]
      8. 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)} \]
      9. 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) \]
      10. 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) \]
      11. 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) \]
      12. times-frac95.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) \]
      13. distribute-frac-neg95.3%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-195.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) \]
      15. *-commutative95.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) \]
      16. associate-/l*95.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) \]
      17. *-commutative95.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. Simplified98.1%

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

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

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

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

    if -8.0000000000000003e-62 < y < 6.50000000000000024e-66

    1. Initial program 90.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 x around 0 70.3%

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

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

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

        \[\leadsto \frac{1}{3} \cdot \left(\color{blue}{\frac{\frac{t}{y}}{z}} - \frac{y}{z}\right) \]
      4. sub-div73.9%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity74.0%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    5. Applied egg-rr74.0%

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around inf 70.3%

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

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

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

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

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

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

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

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

    if 6.50000000000000024e-66 < y

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\left(\frac{\color{blue}{-1 \cdot t}}{\left(z \cdot 3\right) \cdot y} - \left(-\frac{y}{z \cdot 3}\right)\right)\right) \]
      12. times-frac98.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) \]
      13. distribute-frac-neg98.6%

        \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
      14. neg-mul-198.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) \]
      15. *-commutative98.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) \]
      16. associate-/l*98.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) \]
      17. *-commutative98.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. Simplified99.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 87.8%

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

        \[\leadsto x + \frac{\color{blue}{-y}}{z \cdot 3} \]
    7. Simplified87.8%

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

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

Alternative 10: 47.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+111}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.49999999999999983e111 or 3.2e47 < x

    1. Initial program 94.9%

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

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

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

        \[\leadsto \left(\frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} + x\right) + \left(-\frac{y}{z \cdot 3}\right) \]
      5. *-commutative94.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-neg294.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-in94.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-eval94.9%

        \[\leadsto \left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot \color{blue}{-3}} \]
    3. Simplified94.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. Taylor expanded in z around inf 52.8%

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

    if -8.49999999999999983e111 < x < 3.2e47

    1. Initial program 93.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity88.2%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    5. Applied egg-rr88.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around 0 48.3%

      \[\leadsto \frac{\color{blue}{-0.3333333333333333 \cdot y}}{z} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt28.0%

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\sqrt{y \cdot y}}}{z} \]
      3. sqr-neg18.9%

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(-y\right)}}{z} \]
      6. distribute-rgt-neg-in2.3%

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{0.3333333333333333}}{z} \]
      10. metadata-eval2.3%

        \[\leadsto \frac{y \cdot \color{blue}{\frac{1}{3}}}{z} \]
      11. div-inv2.3%

        \[\leadsto \frac{\color{blue}{\frac{y}{3}}}{z} \]
      12. frac-2neg2.3%

        \[\leadsto \frac{\color{blue}{\frac{-y}{-3}}}{z} \]
      13. add-sqr-sqrt1.4%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{-3}}{z} \]
      14. sqrt-unprod19.0%

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

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{y \cdot y}}}{-3}}{z} \]
      16. sqrt-unprod28.0%

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

        \[\leadsto \frac{\frac{\color{blue}{y}}{-3}}{z} \]
      18. metadata-eval48.4%

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

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

Alternative 11: 47.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+111}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.49999999999999948e111 or 1.00000000000000001e43 < x

    1. Initial program 94.9%

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

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

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

        \[\leadsto \left(\frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} + x\right) + \left(-\frac{y}{z \cdot 3}\right) \]
      5. *-commutative94.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-neg294.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-in94.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-eval94.9%

        \[\leadsto \left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot \color{blue}{-3}} \]
    3. Simplified94.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. Taylor expanded in z around inf 52.8%

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

    if -7.49999999999999948e111 < x < 1.00000000000000001e43

    1. Initial program 93.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity88.2%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    5. Applied egg-rr88.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around 0 48.3%

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

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

Alternative 12: 47.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+111}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.2000000000000001e111 or 1.6000000000000001e48 < x

    1. Initial program 94.9%

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

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

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

        \[\leadsto \left(\frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} + x\right) + \left(-\frac{y}{z \cdot 3}\right) \]
      5. *-commutative94.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-neg294.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-in94.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-eval94.9%

        \[\leadsto \left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot \color{blue}{-3}} \]
    3. Simplified94.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. Taylor expanded in z around inf 52.8%

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

    if -6.2000000000000001e111 < x < 1.6000000000000001e48

    1. Initial program 93.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity88.2%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    5. Applied egg-rr88.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around 0 48.2%

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

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

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

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

Alternative 13: 47.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+111}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.49999999999999983e111 or 1.1200000000000001e41 < x

    1. Initial program 94.9%

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

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

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

        \[\leadsto \left(\frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} + x\right) + \left(-\frac{y}{z \cdot 3}\right) \]
      5. *-commutative94.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-neg294.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-in94.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-eval94.9%

        \[\leadsto \left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot \color{blue}{-3}} \]
    3. Simplified94.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. Taylor expanded in z around inf 52.8%

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

    if -8.49999999999999983e111 < x < 1.1200000000000001e41

    1. Initial program 93.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity88.2%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    5. Applied egg-rr88.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around 0 48.2%

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

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

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

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

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

Alternative 14: 47.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+111}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{+45}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.99999999999999965e111 or 1.1e45 < x

    1. Initial program 94.9%

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

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

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

        \[\leadsto \left(\frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} + x\right) + \left(-\frac{y}{z \cdot 3}\right) \]
      5. *-commutative94.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-neg294.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-in94.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-eval94.9%

        \[\leadsto \left(\frac{t}{z \cdot \left(y \cdot 3\right)} + x\right) + \frac{y}{z \cdot \color{blue}{-3}} \]
    3. Simplified94.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. Taylor expanded in z around inf 52.8%

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

    if -7.99999999999999965e111 < x < 1.1e45

    1. Initial program 93.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\frac{t}{y} - y\right)}{3 \cdot z}} \]
      6. *-un-lft-identity88.2%

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

        \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    5. Applied egg-rr88.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{t}{y} - y}{3}}{z}} \]
    6. Taylor expanded in t around 0 48.2%

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

Alternative 15: 95.9% accurate, 1.4× speedup?

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

\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Derivation
  1. Initial program 94.2%

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
    9. remove-double-neg94.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) \]
    10. sub-neg94.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) \]
    11. neg-mul-194.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) \]
    12. times-frac95.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) \]
    13. distribute-frac-neg95.3%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
    14. neg-mul-195.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) \]
    15. *-commutative95.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) \]
    16. associate-/l*95.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) \]
    17. *-commutative95.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. Simplified96.4%

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

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

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

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

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

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

    \[\leadsto x + \color{blue}{\frac{\frac{t}{y} - y}{z \cdot 3}} \]
  7. Add Preprocessing

Alternative 16: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
    9. remove-double-neg94.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) \]
    10. sub-neg94.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) \]
    11. neg-mul-194.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) \]
    12. times-frac95.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) \]
    13. distribute-frac-neg95.3%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
    14. neg-mul-195.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) \]
    15. *-commutative95.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) \]
    16. associate-/l*95.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) \]
    17. *-commutative95.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. Simplified96.4%

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

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

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

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

Alternative 17: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(-\left(\frac{-t}{\left(z \cdot 3\right) \cdot y} + \frac{y}{z \cdot 3}\right)\right)} \]
    9. remove-double-neg94.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) \]
    10. sub-neg94.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) \]
    11. neg-mul-194.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) \]
    12. times-frac95.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) \]
    13. distribute-frac-neg95.3%

      \[\leadsto x + \left(-\left(\frac{-1}{z \cdot 3} \cdot \frac{t}{y} - \color{blue}{\frac{-y}{z \cdot 3}}\right)\right) \]
    14. neg-mul-195.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) \]
    15. *-commutative95.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) \]
    16. associate-/l*95.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) \]
    17. *-commutative95.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. Simplified96.4%

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

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

Alternative 18: 29.9% accurate, 15.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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