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

Percentage Accurate: 95.8% → 97.5%
Time: 13.2s
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.8% 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.5% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999978e34 < (*.f64 z 3)

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 60.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -0.3333333333333333 \cdot \frac{y}{z}\\ t_2 := 0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\ \mathbf{if}\;y \leq -9.2 \cdot 10^{+78}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.32 \cdot 10^{-136}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+55}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+59}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* -0.3333333333333333 (/ y z)))
        (t_2 (* 0.3333333333333333 (/ (/ t y) z))))
   (if (<= y -9.2e+78)
     (/ y (* z -3.0))
     (if (<= y -3.1e+52)
       x
       (if (<= y -3.6e+22)
         t_1
         (if (<= y 1.32e-136)
           t_2
           (if (<= y 1.45e+55) x (if (<= y 4.8e+59) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = -0.3333333333333333 * (y / z);
	double t_2 = 0.3333333333333333 * ((t / y) / z);
	double tmp;
	if (y <= -9.2e+78) {
		tmp = y / (z * -3.0);
	} else if (y <= -3.1e+52) {
		tmp = x;
	} else if (y <= -3.6e+22) {
		tmp = t_1;
	} else if (y <= 1.32e-136) {
		tmp = t_2;
	} else if (y <= 1.45e+55) {
		tmp = x;
	} else if (y <= 4.8e+59) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-0.3333333333333333d0) * (y / z)
    t_2 = 0.3333333333333333d0 * ((t / y) / z)
    if (y <= (-9.2d+78)) then
        tmp = y / (z * (-3.0d0))
    else if (y <= (-3.1d+52)) then
        tmp = x
    else if (y <= (-3.6d+22)) then
        tmp = t_1
    else if (y <= 1.32d-136) then
        tmp = t_2
    else if (y <= 1.45d+55) then
        tmp = x
    else if (y <= 4.8d+59) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = -0.3333333333333333 * (y / z);
	double t_2 = 0.3333333333333333 * ((t / y) / z);
	double tmp;
	if (y <= -9.2e+78) {
		tmp = y / (z * -3.0);
	} else if (y <= -3.1e+52) {
		tmp = x;
	} else if (y <= -3.6e+22) {
		tmp = t_1;
	} else if (y <= 1.32e-136) {
		tmp = t_2;
	} else if (y <= 1.45e+55) {
		tmp = x;
	} else if (y <= 4.8e+59) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = -0.3333333333333333 * (y / z)
	t_2 = 0.3333333333333333 * ((t / y) / z)
	tmp = 0
	if y <= -9.2e+78:
		tmp = y / (z * -3.0)
	elif y <= -3.1e+52:
		tmp = x
	elif y <= -3.6e+22:
		tmp = t_1
	elif y <= 1.32e-136:
		tmp = t_2
	elif y <= 1.45e+55:
		tmp = x
	elif y <= 4.8e+59:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(-0.3333333333333333 * Float64(y / z))
	t_2 = Float64(0.3333333333333333 * Float64(Float64(t / y) / z))
	tmp = 0.0
	if (y <= -9.2e+78)
		tmp = Float64(y / Float64(z * -3.0));
	elseif (y <= -3.1e+52)
		tmp = x;
	elseif (y <= -3.6e+22)
		tmp = t_1;
	elseif (y <= 1.32e-136)
		tmp = t_2;
	elseif (y <= 1.45e+55)
		tmp = x;
	elseif (y <= 4.8e+59)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = -0.3333333333333333 * (y / z);
	t_2 = 0.3333333333333333 * ((t / y) / z);
	tmp = 0.0;
	if (y <= -9.2e+78)
		tmp = y / (z * -3.0);
	elseif (y <= -3.1e+52)
		tmp = x;
	elseif (y <= -3.6e+22)
		tmp = t_1;
	elseif (y <= 1.32e-136)
		tmp = t_2;
	elseif (y <= 1.45e+55)
		tmp = x;
	elseif (y <= 4.8e+59)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.2e+78], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.1e+52], x, If[LessEqual[y, -3.6e+22], t$95$1, If[LessEqual[y, 1.32e-136], t$95$2, If[LessEqual[y, 1.45e+55], x, If[LessEqual[y, 4.8e+59], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -0.3333333333333333 \cdot \frac{y}{z}\\
t_2 := 0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\
\mathbf{if}\;y \leq -9.2 \cdot 10^{+78}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\

\mathbf{elif}\;y \leq -3.1 \cdot 10^{+52}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -3.6 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.32 \cdot 10^{-136}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 1.45 \cdot 10^{+55}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{+59}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{t}{y} - y}}{z} \cdot \frac{1}{3} \]
      18. metadata-eval83.3%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      4. distribute-neg-frac81.7%

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

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

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

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

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

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

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

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

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

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

    if -9.2000000000000008e78 < y < -3.1e52 or 1.3200000000000001e-136 < y < 1.4499999999999999e55

    1. Initial program 97.4%

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

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

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

    if -3.1e52 < y < -3.6e22 or 4.8000000000000004e59 < y

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e22 < y < 1.3200000000000001e-136 or 1.4499999999999999e55 < y < 4.8000000000000004e59

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.2 \cdot 10^{+78}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{+22}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 1.32 \cdot 10^{-136}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+55}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+59}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 62.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{if}\;y \leq -9.2 \cdot 10^{+78}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -4.1 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.32 \cdot 10^{-136}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+57}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+59}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* -0.3333333333333333 (/ y z))))
   (if (<= y -9.2e+78)
     (/ y (* z -3.0))
     (if (<= y -1.95e+52)
       x
       (if (<= y -4.1e+22)
         t_1
         (if (<= y 1.32e-136)
           (* 0.3333333333333333 (/ (/ t z) y))
           (if (<= y 3.2e+57)
             x
             (if (<= y 5.4e+59)
               (* 0.3333333333333333 (/ (/ t y) z))
               t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = -0.3333333333333333 * (y / z);
	double tmp;
	if (y <= -9.2e+78) {
		tmp = y / (z * -3.0);
	} else if (y <= -1.95e+52) {
		tmp = x;
	} else if (y <= -4.1e+22) {
		tmp = t_1;
	} else if (y <= 1.32e-136) {
		tmp = 0.3333333333333333 * ((t / z) / y);
	} else if (y <= 3.2e+57) {
		tmp = x;
	} else if (y <= 5.4e+59) {
		tmp = 0.3333333333333333 * ((t / y) / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (-0.3333333333333333d0) * (y / z)
    if (y <= (-9.2d+78)) then
        tmp = y / (z * (-3.0d0))
    else if (y <= (-1.95d+52)) then
        tmp = x
    else if (y <= (-4.1d+22)) then
        tmp = t_1
    else if (y <= 1.32d-136) then
        tmp = 0.3333333333333333d0 * ((t / z) / y)
    else if (y <= 3.2d+57) then
        tmp = x
    else if (y <= 5.4d+59) then
        tmp = 0.3333333333333333d0 * ((t / y) / z)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = -0.3333333333333333 * (y / z);
	double tmp;
	if (y <= -9.2e+78) {
		tmp = y / (z * -3.0);
	} else if (y <= -1.95e+52) {
		tmp = x;
	} else if (y <= -4.1e+22) {
		tmp = t_1;
	} else if (y <= 1.32e-136) {
		tmp = 0.3333333333333333 * ((t / z) / y);
	} else if (y <= 3.2e+57) {
		tmp = x;
	} else if (y <= 5.4e+59) {
		tmp = 0.3333333333333333 * ((t / y) / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = -0.3333333333333333 * (y / z)
	tmp = 0
	if y <= -9.2e+78:
		tmp = y / (z * -3.0)
	elif y <= -1.95e+52:
		tmp = x
	elif y <= -4.1e+22:
		tmp = t_1
	elif y <= 1.32e-136:
		tmp = 0.3333333333333333 * ((t / z) / y)
	elif y <= 3.2e+57:
		tmp = x
	elif y <= 5.4e+59:
		tmp = 0.3333333333333333 * ((t / y) / z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(-0.3333333333333333 * Float64(y / z))
	tmp = 0.0
	if (y <= -9.2e+78)
		tmp = Float64(y / Float64(z * -3.0));
	elseif (y <= -1.95e+52)
		tmp = x;
	elseif (y <= -4.1e+22)
		tmp = t_1;
	elseif (y <= 1.32e-136)
		tmp = Float64(0.3333333333333333 * Float64(Float64(t / z) / y));
	elseif (y <= 3.2e+57)
		tmp = x;
	elseif (y <= 5.4e+59)
		tmp = Float64(0.3333333333333333 * Float64(Float64(t / y) / z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = -0.3333333333333333 * (y / z);
	tmp = 0.0;
	if (y <= -9.2e+78)
		tmp = y / (z * -3.0);
	elseif (y <= -1.95e+52)
		tmp = x;
	elseif (y <= -4.1e+22)
		tmp = t_1;
	elseif (y <= 1.32e-136)
		tmp = 0.3333333333333333 * ((t / z) / y);
	elseif (y <= 3.2e+57)
		tmp = x;
	elseif (y <= 5.4e+59)
		tmp = 0.3333333333333333 * ((t / y) / z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.2e+78], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.95e+52], x, If[LessEqual[y, -4.1e+22], t$95$1, If[LessEqual[y, 1.32e-136], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+57], x, If[LessEqual[y, 5.4e+59], N[(0.3333333333333333 * N[(N[(t / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := -0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -9.2 \cdot 10^{+78}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\

\mathbf{elif}\;y \leq -1.95 \cdot 10^{+52}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -4.1 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+57}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 5.4 \cdot 10^{+59}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{t}{y} - y}}{z} \cdot \frac{1}{3} \]
      18. metadata-eval83.3%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      4. distribute-neg-frac81.7%

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

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

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

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

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

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

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

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

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

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

    if -9.2000000000000008e78 < y < -1.95e52 or 1.3200000000000001e-136 < y < 3.20000000000000029e57

    1. Initial program 97.4%

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

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

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

    if -1.95e52 < y < -4.09999999999999979e22 or 5.4000000000000002e59 < y

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.09999999999999979e22 < y < 1.3200000000000001e-136

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

    if 3.20000000000000029e57 < y < 5.4000000000000002e59

    1. Initial program 3.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.2 \cdot 10^{+78}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -4.1 \cdot 10^{+22}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 1.32 \cdot 10^{-136}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+57}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+59}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 61.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -1.12 \cdot 10^{+52}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -3.45 \cdot 10^{+22} \lor \neg \left(y \leq 4.05 \cdot 10^{+49}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\

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


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{t}{y} - y}}{z} \cdot \frac{1}{3} \]
      18. metadata-eval83.3%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      4. distribute-neg-frac81.7%

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

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

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

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

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

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

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

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

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

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

    if -1.15e79 < y < -1.12000000000000002e52

    1. Initial program 100.0%

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

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

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

    if -1.12000000000000002e52 < y < -3.4499999999999999e22 or 4.04999999999999989e49 < y

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4499999999999999e22 < y < 4.04999999999999989e49

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+79}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq -1.12 \cdot 10^{+52}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -3.45 \cdot 10^{+22} \lor \neg \left(y \leq 4.05 \cdot 10^{+49}\right):\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 81.1% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 98.2%

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

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

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

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

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

    if -2e14 < (*.f64 z 3) < 2.00000000000000007e-10

    1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-\left(y - \frac{t}{y}\right)}{z} \cdot \frac{1}{3}} \]
      7. neg-sub095.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{t}{y} - y}}{z} \cdot \frac{1}{3} \]
      18. metadata-eval95.8%

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

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

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

    if 2.00000000000000007e-10 < (*.f64 z 3)

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 97.5% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 97.9%

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

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

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

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

    if -2.00000000000000009e48 < (*.f64 z 3)

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 97.6% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 98.1%

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

    if -3.99999999999999978e34 < (*.f64 z 3)

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 89.3% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.7e23 < y < 3.70000000000000018e49

    1. Initial program 87.1%

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

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

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

    if 3.70000000000000018e49 < y

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

Alternative 9: 91.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.6000000000000003e25 < y < 4.8000000000000004e59

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{\frac{\frac{t}{z}}{3}}{y}} \]
    6. Simplified89.8%

      \[\leadsto x + \color{blue}{\frac{\frac{\frac{t}{z}}{3}}{y}} \]
    7. Step-by-step derivation
      1. clear-num89.8%

        \[\leadsto x + \color{blue}{\frac{1}{\frac{y}{\frac{\frac{t}{z}}{3}}}} \]
      2. inv-pow89.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{\frac{\color{blue}{0.3333333333333333}}{y}}{\frac{z}{t}} \]
    10. Simplified89.8%

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

    if 4.8000000000000004e59 < y

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

Alternative 10: 91.6% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0999999999999999e25 < y < 4.8000000000000004e59

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{\frac{\frac{t}{z}}{3}}{y}} \]
    6. Simplified89.8%

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

    if 4.8000000000000004e59 < y

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

Alternative 11: 78.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{-63} \lor \neg \left(y \leq 1.32 \cdot 10^{-136}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.90000000000000022e-63 or 1.3200000000000001e-136 < y

    1. Initial program 96.8%

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

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

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

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

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

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

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

    if -3.90000000000000022e-63 < y < 1.3200000000000001e-136

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 78.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{-65} \lor \neg \left(y \leq 1.3 \cdot 10^{-136}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.24999999999999996e-65 or 1.29999999999999998e-136 < y

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.24999999999999996e-65 < y < 1.29999999999999998e-136

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 77.9% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 98.7%

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

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

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

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

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

    if -2.99999999999999998e-65 < y < 2.5500000000000001e-138

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

    if 2.5500000000000001e-138 < y

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

Alternative 14: 48.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.6e67 or 5.60000000000000047e64 < x

    1. Initial program 94.5%

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

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

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

    if -2.6e67 < x < 5.60000000000000047e64

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 48.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.74999999999999994e69 or 9.5000000000000003e62 < x

    1. Initial program 94.5%

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

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

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

    if -1.74999999999999994e69 < x < 9.5000000000000003e62

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{t}{y} - y}}{z} \cdot \frac{1}{3} \]
      18. metadata-eval87.1%

        \[\leadsto \frac{\frac{t}{y} - y}{z} \cdot \color{blue}{0.3333333333333333} \]
      19. *-commutative87.1%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      4. distribute-neg-frac45.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

Alternative 17: 96.0% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
  7. Final simplification96.9%

    \[\leadsto x - \frac{y - \frac{t}{y}}{z \cdot 3} \]
  8. Add Preprocessing

Alternative 18: 30.4% 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 91.4%

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

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

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

    \[\leadsto x \]
  6. Add Preprocessing

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

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

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