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

Percentage Accurate: 95.7% → 99.6%
Time: 16.3s
Alternatives: 23
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 23 alternatives:

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

Initial Program: 95.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 99.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*99.7%

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

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

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

    if -1.9999999999999999e35 < (*.f64 z 3) < 4.99999999999999972e-30

    1. Initial program 91.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*91.5%

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

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

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

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

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

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

        \[\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}} \]

    if 4.99999999999999972e-30 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

Alternative 2: 89.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{if}\;y \leq -130000000000:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-165}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.16 \cdot 10^{-110}:\\ \;\;\;\;\frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+26}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* 0.3333333333333333 (/ t (* y z))))))
   (if (<= y -130000000000.0)
     (- x (* 0.3333333333333333 (/ y z)))
     (if (<= y 5.2e-165)
       t_1
       (if (<= y 1.16e-110)
         (* (/ 0.3333333333333333 z) (- (/ t y) y))
         (if (<= y 8.5e+26) t_1 (+ x (* y (/ -0.3333333333333333 z)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (0.3333333333333333 * (t / (y * z)));
	double tmp;
	if (y <= -130000000000.0) {
		tmp = x - (0.3333333333333333 * (y / z));
	} else if (y <= 5.2e-165) {
		tmp = t_1;
	} else if (y <= 1.16e-110) {
		tmp = (0.3333333333333333 / z) * ((t / y) - y);
	} else if (y <= 8.5e+26) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x + (0.3333333333333333d0 * (t / (y * z)))
    if (y <= (-130000000000.0d0)) then
        tmp = x - (0.3333333333333333d0 * (y / z))
    else if (y <= 5.2d-165) then
        tmp = t_1
    else if (y <= 1.16d-110) then
        tmp = (0.3333333333333333d0 / z) * ((t / y) - y)
    else if (y <= 8.5d+26) then
        tmp = t_1
    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 t_1 = x + (0.3333333333333333 * (t / (y * z)));
	double tmp;
	if (y <= -130000000000.0) {
		tmp = x - (0.3333333333333333 * (y / z));
	} else if (y <= 5.2e-165) {
		tmp = t_1;
	} else if (y <= 1.16e-110) {
		tmp = (0.3333333333333333 / z) * ((t / y) - y);
	} else if (y <= 8.5e+26) {
		tmp = t_1;
	} else {
		tmp = x + (y * (-0.3333333333333333 / z));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (0.3333333333333333 * (t / (y * z)))
	tmp = 0
	if y <= -130000000000.0:
		tmp = x - (0.3333333333333333 * (y / z))
	elif y <= 5.2e-165:
		tmp = t_1
	elif y <= 1.16e-110:
		tmp = (0.3333333333333333 / z) * ((t / y) - y)
	elif y <= 8.5e+26:
		tmp = t_1
	else:
		tmp = x + (y * (-0.3333333333333333 / z))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z))))
	tmp = 0.0
	if (y <= -130000000000.0)
		tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z)));
	elseif (y <= 5.2e-165)
		tmp = t_1;
	elseif (y <= 1.16e-110)
		tmp = Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y));
	elseif (y <= 8.5e+26)
		tmp = t_1;
	else
		tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (0.3333333333333333 * (t / (y * z)));
	tmp = 0.0;
	if (y <= -130000000000.0)
		tmp = x - (0.3333333333333333 * (y / z));
	elseif (y <= 5.2e-165)
		tmp = t_1;
	elseif (y <= 1.16e-110)
		tmp = (0.3333333333333333 / z) * ((t / y) - y);
	elseif (y <= 8.5e+26)
		tmp = t_1;
	else
		tmp = x + (y * (-0.3333333333333333 / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -130000000000.0], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-165], t$95$1, If[LessEqual[y, 1.16e-110], N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+26], t$95$1, N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 5.2 \cdot 10^{-165}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+26}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 98.3%

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

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

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

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

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

    if -1.3e11 < y < 5.20000000000000015e-165 or 1.16000000000000001e-110 < y < 8.5e26

    1. Initial program 95.6%

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

      \[\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 92.3%

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

    if 5.20000000000000015e-165 < y < 1.16000000000000001e-110

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{t}{y}} - \frac{y \cdot 0.3333333333333333}{z} \]
      4. fma-neg88.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y}, -\frac{y \cdot 0.3333333333333333}{z}\right)} \]
      5. fma-def88.1%

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

        \[\leadsto \frac{0.3333333333333333}{z} \cdot \frac{t}{y} + \color{blue}{\frac{-y \cdot 0.3333333333333333}{z}} \]
      7. distribute-lft-neg-in88.1%

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

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

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

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

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

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

    if 8.5e26 < y

    1. Initial program 99.9%

      \[\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 96.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -130000000000:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-165}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{elif}\;y \leq 1.16 \cdot 10^{-110}:\\ \;\;\;\;\frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+26}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 88.7% accurate, 0.5× speedup?

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

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

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

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

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

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


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

    1. Initial program 98.3%

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

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

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

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

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

    if -7.2e10 < y < 5.20000000000000015e-165

    1. Initial program 94.6%

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

      \[\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 92.3%

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

    if 5.20000000000000015e-165 < y < 1.16000000000000001e-110

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{t}{y}} - \frac{y \cdot 0.3333333333333333}{z} \]
      4. fma-neg88.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y}, -\frac{y \cdot 0.3333333333333333}{z}\right)} \]
      5. fma-def88.1%

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

        \[\leadsto \frac{0.3333333333333333}{z} \cdot \frac{t}{y} + \color{blue}{\frac{-y \cdot 0.3333333333333333}{z}} \]
      7. distribute-lft-neg-in88.1%

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

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

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

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

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

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

    if 1.16000000000000001e-110 < y < 6.2e20

    1. Initial program 99.7%

      \[\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 t around inf 92.1%

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

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

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

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

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

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

    if 6.2e20 < y

    1. Initial program 99.9%

      \[\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 96.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -72000000000:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-165}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{elif}\;y \leq 1.16 \cdot 10^{-110}:\\ \;\;\;\;\frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{+20}:\\ \;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \frac{t}{y}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 88.8% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 98.3%

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

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

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

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

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

    if -2.3e11 < y < 5.1e-165

    1. Initial program 94.6%

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

      \[\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 92.3%

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

    if 5.1e-165 < y < 1.16000000000000001e-110

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{t}{y}} - \frac{y \cdot 0.3333333333333333}{z} \]
      4. fma-neg88.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y}, -\frac{y \cdot 0.3333333333333333}{z}\right)} \]
      5. fma-def88.1%

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

        \[\leadsto \frac{0.3333333333333333}{z} \cdot \frac{t}{y} + \color{blue}{\frac{-y \cdot 0.3333333333333333}{z}} \]
      7. distribute-lft-neg-in88.1%

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

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

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

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

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

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

    if 1.16000000000000001e-110 < y < 5.2e20

    1. Initial program 99.7%

      \[\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 t around inf 92.1%

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

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

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

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

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

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

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

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

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

    if 5.2e20 < y

    1. Initial program 99.9%

      \[\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 96.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -230000000000:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{-165}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{elif}\;y \leq 1.16 \cdot 10^{-110}:\\ \;\;\;\;\frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{+20}:\\ \;\;\;\;x + \frac{0.3333333333333333}{z \cdot \frac{y}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 99.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 3) < -1.9999999999999999e35 or 4.99999999999999972e-30 < (*.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.7%

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

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

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

    if -1.9999999999999999e35 < (*.f64 z 3) < 4.99999999999999972e-30

    1. Initial program 91.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*91.5%

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

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

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

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

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

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

        \[\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}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.8%

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

Alternative 6: 81.7% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 99.7%

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

      \[\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 83.7%

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

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

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

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

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

    if -1.00000000000000006e63 < (*.f64 z 3) < 2e20

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv95.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{t}{y}} - \frac{y \cdot 0.3333333333333333}{z} \]
      4. fma-neg91.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y}, -\frac{y \cdot 0.3333333333333333}{z}\right)} \]
      5. fma-def91.0%

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

        \[\leadsto \frac{0.3333333333333333}{z} \cdot \frac{t}{y} + \color{blue}{\frac{-y \cdot 0.3333333333333333}{z}} \]
      7. distribute-lft-neg-in91.0%

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

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

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

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

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

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

    if 2e20 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

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

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

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

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

Alternative 7: 61.9% accurate, 0.7× speedup?

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

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

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

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

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


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

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv98.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-y \cdot 0.3333333333333333}}{z} \]
      5. distribute-lft-neg-in68.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{z \cdot \color{blue}{-3}} \]
      5. *-commutative68.4%

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

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

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

    if -52000 < y < 5.80000000000000007e-105

    1. Initial program 90.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity90.5%

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

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

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

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

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

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

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

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

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

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

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

    if 5.80000000000000007e-105 < y < 4.49999999999999967e144

    1. Initial program 99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 \cdot x} + y \cdot \frac{-0.3333333333333333}{z} \]
      2. fma-def70.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1, x, y \cdot \frac{-0.3333333333333333}{z}\right)} \]
      3. add-sqr-sqrt37.7%

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

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

        \[\leadsto \mathsf{fma}\left(1, x, y \cdot \sqrt{\color{blue}{\frac{-0.3333333333333333 \cdot -0.3333333333333333}{z \cdot z}}}\right) \]
      6. metadata-eval63.4%

        \[\leadsto \mathsf{fma}\left(1, x, y \cdot \sqrt{\frac{\color{blue}{0.1111111111111111}}{z \cdot z}}\right) \]
      7. metadata-eval63.4%

        \[\leadsto \mathsf{fma}\left(1, x, y \cdot \sqrt{\frac{\color{blue}{0.3333333333333333 \cdot 0.3333333333333333}}{z \cdot z}}\right) \]
      8. frac-times63.4%

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

        \[\leadsto \mathsf{fma}\left(1, x, y \cdot \color{blue}{\left(\sqrt{\frac{0.3333333333333333}{z}} \cdot \sqrt{\frac{0.3333333333333333}{z}}\right)}\right) \]
      10. add-sqr-sqrt57.8%

        \[\leadsto \mathsf{fma}\left(1, x, y \cdot \color{blue}{\frac{0.3333333333333333}{z}}\right) \]
      11. associate-*r/57.8%

        \[\leadsto \mathsf{fma}\left(1, x, \color{blue}{\frac{y \cdot 0.3333333333333333}{z}}\right) \]
    8. Applied egg-rr57.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1, x, \frac{y \cdot 0.3333333333333333}{z}\right)} \]
    9. Step-by-step derivation
      1. fma-udef57.8%

        \[\leadsto \color{blue}{1 \cdot x + \frac{y \cdot 0.3333333333333333}{z}} \]
      2. *-lft-identity57.8%

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

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

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

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

    if 4.49999999999999967e144 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv91.4%

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(-0.3333333333333333\right)}}{z} \]
      4. distribute-rgt-neg-in81.1%

        \[\leadsto \frac{\color{blue}{-y \cdot 0.3333333333333333}}{z} \]
      5. distribute-lft-neg-in81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 59.9% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+144}:\\
\;\;\;\;x\\

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


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

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv98.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-y \cdot 0.3333333333333333}}{z} \]
      5. distribute-lft-neg-in68.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{z \cdot \color{blue}{-3}} \]
      5. *-commutative68.4%

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

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

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

    if -1.6e9 < y < 8.5000000000000006e-114

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv97.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \frac{t}{y}} - \frac{y \cdot 0.3333333333333333}{z} \]
      4. fma-neg66.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y}, -\frac{y \cdot 0.3333333333333333}{z}\right)} \]
      5. fma-def66.7%

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

        \[\leadsto \frac{0.3333333333333333}{z} \cdot \frac{t}{y} + \color{blue}{\frac{-y \cdot 0.3333333333333333}{z}} \]
      7. distribute-lft-neg-in66.7%

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

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

        \[\leadsto \frac{0.3333333333333333}{z} \cdot \frac{t}{y} + \color{blue}{\frac{0.3333333333333333}{z} \cdot \left(-y\right)} \]
      10. distribute-lft-out66.7%

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} + \left(-y\right)\right)} \]
      11. sub-neg66.7%

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

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

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

    if 8.5000000000000006e-114 < y < 4.49999999999999967e144

    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 x around inf 54.9%

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

    if 4.49999999999999967e144 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv91.4%

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(-0.3333333333333333\right)}}{z} \]
      4. distribute-rgt-neg-in81.1%

        \[\leadsto \frac{\color{blue}{-y \cdot 0.3333333333333333}}{z} \]
      5. distribute-lft-neg-in81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 61.9% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;y \leq 5.8 \cdot 10^{+144}:\\
\;\;\;\;x\\

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


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

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv98.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-y \cdot 0.3333333333333333}}{z} \]
      5. distribute-lft-neg-in68.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{z \cdot \color{blue}{-3}} \]
      5. *-commutative68.4%

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

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

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

    if -2.25e10 < y < 5.5000000000000001e-106

    1. Initial program 90.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity90.5%

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

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

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

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

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

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

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

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

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

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

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

    if 5.5000000000000001e-106 < y < 5.79999999999999996e144

    1. Initial program 99.8%

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

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

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

    if 5.79999999999999996e144 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv91.4%

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(-0.3333333333333333\right)}}{z} \]
      4. distribute-rgt-neg-in81.1%

        \[\leadsto \frac{\color{blue}{-y \cdot 0.3333333333333333}}{z} \]
      5. distribute-lft-neg-in81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 96.9% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 7.5000000000000003e-174

    1. Initial program 96.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*96.1%

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

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

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

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

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

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

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

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

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

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

        \[\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-inv97.8%

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

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

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

    if 7.5000000000000003e-174 < y

    1. Initial program 95.2%

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

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

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

      \[\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. *-commutative95.2%

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

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

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

        \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
      5. associate-/r*99.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}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.6%

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

Alternative 11: 93.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 2.7 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{t}{z} \cdot \frac{0.3333333333333333}{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.1e11

    1. Initial program 98.3%

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

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

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

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

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

    if -5.1e11 < y < 2.6999999999999999e23

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

    if 2.6999999999999999e23 < y

    1. Initial program 99.9%

      \[\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 96.7%

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

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

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

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

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

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

Alternative 12: 93.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 98.3%

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

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

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

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

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

    if -5e10 < y < 2.9e22

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{z} \cdot \color{blue}{\frac{1}{\frac{y}{0.3333333333333333}}} + x \]
      2. un-div-inv93.0%

        \[\leadsto \color{blue}{\frac{\frac{t}{z}}{\frac{y}{0.3333333333333333}}} + x \]
      3. div-inv93.1%

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

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

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

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

    if 2.9e22 < y

    1. Initial program 99.9%

      \[\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 96.7%

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

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

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

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

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

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

Alternative 13: 77.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -14600 \lor \neg \left(y \leq 3.2 \cdot 10^{-111}\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 -14600.0) (not (<= y 3.2e-111)))
   (+ x (* y (/ -0.3333333333333333 z)))
   (* 0.3333333333333333 (/ (/ t z) y))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -14600.0) || !(y <= 3.2e-111)) {
		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 <= (-14600.0d0)) .or. (.not. (y <= 3.2d-111))) 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 <= -14600.0) || !(y <= 3.2e-111)) {
		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 <= -14600.0) or not (y <= 3.2e-111):
		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 <= -14600.0) || !(y <= 3.2e-111))
		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 <= -14600.0) || ~((y <= 3.2e-111)))
		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, -14600.0], N[Not[LessEqual[y, 3.2e-111]], $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 -14600 \lor \neg \left(y \leq 3.2 \cdot 10^{-111}\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 < -14600 or 3.1999999999999998e-111 < y

    1. Initial program 98.6%

      \[\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 90.6%

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

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

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

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

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

    if -14600 < y < 3.1999999999999998e-111

    1. Initial program 91.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity91.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 77.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -14600:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-120}:\\ \;\;\;\;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 -14600.0)
   (- x (* 0.3333333333333333 (/ y z)))
   (if (<= y 7e-120)
     (* 0.3333333333333333 (/ (/ t z) y))
     (+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -14600.0) {
		tmp = x - (0.3333333333333333 * (y / z));
	} else if (y <= 7e-120) {
		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 <= (-14600.0d0)) then
        tmp = x - (0.3333333333333333d0 * (y / z))
    else if (y <= 7d-120) 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 <= -14600.0) {
		tmp = x - (0.3333333333333333 * (y / z));
	} else if (y <= 7e-120) {
		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 <= -14600.0:
		tmp = x - (0.3333333333333333 * (y / z))
	elif y <= 7e-120:
		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 <= -14600.0)
		tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z)));
	elseif (y <= 7e-120)
		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 <= -14600.0)
		tmp = x - (0.3333333333333333 * (y / z));
	elseif (y <= 7e-120)
		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, -14600.0], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-120], 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 -14600:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

\mathbf{elif}\;y \leq 7 \cdot 10^{-120}:\\
\;\;\;\;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 < -14600

    1. Initial program 98.3%

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

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

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

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

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

    if -14600 < y < 7e-120

    1. Initial program 91.3%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity91.3%

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

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

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

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

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

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

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

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

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

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

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

    if 7e-120 < y

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

Alternative 15: 47.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+43} \lor \neg \left(y \leq 4.5 \cdot 10^{+144}\right):\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.80000000000000005e43 or 4.49999999999999967e144 < y

    1. Initial program 98.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*98.8%

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

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

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

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

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

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

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

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

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

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

        \[\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-inv94.8%

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

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

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

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

    if -1.80000000000000005e43 < y < 4.49999999999999967e144

    1. Initial program 93.6%

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

      \[\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 35.8%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.6%

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

Alternative 16: 47.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.7 \cdot 10^{+42} \lor \neg \left(y \leq 1.7 \cdot 10^{+160}\right):\\
\;\;\;\;\frac{y}{\frac{z}{-0.3333333333333333}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.6999999999999999e42 or 1.70000000000000015e160 < y

    1. Initial program 98.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*98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.6999999999999999e42 < y < 1.70000000000000015e160

    1. Initial program 93.7%

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

      \[\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 35.9%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.6%

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

Alternative 17: 47.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 1.7 \cdot 10^{+160}:\\
\;\;\;\;x\\

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


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

    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 \color{blue}{\frac{t}{z \cdot \left(y \cdot 3\right)} + \left(x - \frac{y}{z \cdot 3}\right)} \]
      2. *-commutative97.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e43 < y < 1.70000000000000015e160

    1. Initial program 93.7%

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

      \[\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 35.9%

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

    if 1.70000000000000015e160 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv91.0%

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(-0.3333333333333333\right)}}{z} \]
      4. distribute-rgt-neg-in82.5%

        \[\leadsto \frac{\color{blue}{-y \cdot 0.3333333333333333}}{z} \]
      5. distribute-lft-neg-in82.5%

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

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

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

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

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

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

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

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

Alternative 18: 47.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 1.7 \cdot 10^{+160}:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

    if -1.80000000000000005e43 < y < 1.70000000000000015e160

    1. Initial program 93.7%

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

      \[\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 35.9%

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

    if 1.70000000000000015e160 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv91.0%

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

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

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

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

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

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

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

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

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

Alternative 19: 47.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 1.7 \cdot 10^{+160}:\\
\;\;\;\;x\\

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


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

    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 \color{blue}{\frac{t}{z \cdot \left(y \cdot 3\right)} + \left(x - \frac{y}{z \cdot 3}\right)} \]
      2. *-commutative97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(-0.3333333333333333\right)}}{z} \]
      4. distribute-rgt-neg-in74.1%

        \[\leadsto \frac{\color{blue}{-y \cdot 0.3333333333333333}}{z} \]
      5. distribute-lft-neg-in74.1%

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(-\frac{0.3333333333333333}{z}\right)} \]
      9. distribute-neg-frac74.1%

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

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

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

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

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

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

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

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

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

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

    if -9.50000000000000019e42 < y < 1.70000000000000015e160

    1. Initial program 93.7%

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

      \[\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 35.9%

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

    if 1.70000000000000015e160 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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-inv91.0%

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

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

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

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

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

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

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

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

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

Alternative 20: 47.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+144}:\\
\;\;\;\;x\\

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


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

    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 \color{blue}{\frac{t}{z \cdot \left(y \cdot 3\right)} + \left(x - \frac{y}{z \cdot 3}\right)} \]
      2. *-commutative97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot \color{blue}{\left(-0.3333333333333333\right)}}{z} \]
      4. distribute-rgt-neg-in74.1%

        \[\leadsto \frac{\color{blue}{-y \cdot 0.3333333333333333}}{z} \]
      5. distribute-lft-neg-in74.1%

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

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

        \[\leadsto \color{blue}{-y \cdot \frac{0.3333333333333333}{z}} \]
      8. distribute-rgt-neg-in74.1%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{0.3333333333333333}{z}\right)} \]
      9. distribute-neg-frac74.1%

        \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
      10. metadata-eval74.1%

        \[\leadsto y \cdot \frac{\color{blue}{-0.3333333333333333}}{z} \]
    9. Simplified74.1%

      \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z}} \]
    10. Step-by-step derivation
      1. associate-*r/74.1%

        \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
      2. associate-/l*74.1%

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
      3. div-inv74.2%

        \[\leadsto \frac{y}{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}} \]
      4. metadata-eval74.2%

        \[\leadsto \frac{y}{z \cdot \color{blue}{-3}} \]
      5. *-commutative74.2%

        \[\leadsto \frac{y}{\color{blue}{-3 \cdot z}} \]
      6. associate-/r*74.2%

        \[\leadsto \color{blue}{\frac{\frac{y}{-3}}{z}} \]
    11. Applied egg-rr74.2%

      \[\leadsto \color{blue}{\frac{\frac{y}{-3}}{z}} \]

    if -1.7500000000000001e43 < y < 4.49999999999999967e144

    1. Initial program 93.6%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Simplified92.3%

      \[\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 35.8%

      \[\leadsto \color{blue}{x} \]

    if 4.49999999999999967e144 < y

    1. Initial program 99.9%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. associate-*l*99.9%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.9%

        \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative99.9%

        \[\leadsto \color{blue}{\frac{t}{z \cdot \left(y \cdot 3\right)} + \left(x - \frac{y}{z \cdot 3}\right)} \]
      2. *-commutative99.9%

        \[\leadsto \frac{t}{z \cdot \color{blue}{\left(3 \cdot y\right)}} + \left(x - \frac{y}{z \cdot 3}\right) \]
      3. associate-*l*99.9%

        \[\leadsto \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} + \left(x - \frac{y}{z \cdot 3}\right) \]
      4. associate-+r-99.9%

        \[\leadsto \color{blue}{\left(\frac{t}{\left(z \cdot 3\right) \cdot y} + x\right) - \frac{y}{z \cdot 3}} \]
      5. associate-*l*99.9%

        \[\leadsto \left(\frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} + x\right) - \frac{y}{z \cdot 3} \]
      6. *-commutative99.9%

        \[\leadsto \left(\frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} + x\right) - \frac{y}{z \cdot 3} \]
      7. associate-/r*91.4%

        \[\leadsto \left(\color{blue}{\frac{\frac{t}{z}}{y \cdot 3}} + x\right) - \frac{y}{z \cdot 3} \]
      8. div-inv91.4%

        \[\leadsto \left(\frac{\frac{t}{z}}{y \cdot 3} + x\right) - \color{blue}{y \cdot \frac{1}{z \cdot 3}} \]
      9. metadata-eval91.4%

        \[\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-inv91.4%

        \[\leadsto \left(\frac{\frac{t}{z}}{y \cdot 3} + x\right) - y \cdot \frac{1}{\color{blue}{\frac{z}{0.3333333333333333}}} \]
      11. clear-num91.3%

        \[\leadsto \left(\frac{\frac{t}{z}}{y \cdot 3} + x\right) - y \cdot \color{blue}{\frac{0.3333333333333333}{z}} \]
    6. Applied egg-rr91.3%

      \[\leadsto \color{blue}{\left(\frac{\frac{t}{z}}{y \cdot 3} + x\right) - y \cdot \frac{0.3333333333333333}{z}} \]
    7. Taylor expanded in y around inf 81.1%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
    8. Step-by-step derivation
      1. associate-*r/81.1%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative81.1%

        \[\leadsto \frac{\color{blue}{y \cdot -0.3333333333333333}}{z} \]
      3. metadata-eval81.1%

        \[\leadsto \frac{y \cdot \color{blue}{\left(-0.3333333333333333\right)}}{z} \]
      4. distribute-rgt-neg-in81.1%

        \[\leadsto \frac{\color{blue}{-y \cdot 0.3333333333333333}}{z} \]
      5. distribute-lft-neg-in81.1%

        \[\leadsto \frac{\color{blue}{\left(-y\right) \cdot 0.3333333333333333}}{z} \]
      6. associate-*r/81.1%

        \[\leadsto \color{blue}{\left(-y\right) \cdot \frac{0.3333333333333333}{z}} \]
      7. distribute-lft-neg-out81.1%

        \[\leadsto \color{blue}{-y \cdot \frac{0.3333333333333333}{z}} \]
      8. distribute-rgt-neg-in81.1%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{0.3333333333333333}{z}\right)} \]
      9. distribute-neg-frac81.1%

        \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
      10. metadata-eval81.1%

        \[\leadsto y \cdot \frac{\color{blue}{-0.3333333333333333}}{z} \]
    9. Simplified81.1%

      \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z}} \]
    10. Step-by-step derivation
      1. associate-*r/81.1%

        \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
      2. associate-/l*81.2%

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
      3. div-inv81.2%

        \[\leadsto \frac{y}{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}} \]
      4. metadata-eval81.2%

        \[\leadsto \frac{y}{z \cdot \color{blue}{-3}} \]
      5. associate-/r*81.2%

        \[\leadsto \color{blue}{\frac{\frac{y}{z}}{-3}} \]
    11. Applied egg-rr81.2%

      \[\leadsto \color{blue}{\frac{\frac{y}{z}}{-3}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification52.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+43}:\\ \;\;\;\;\frac{\frac{y}{-3}}{z}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+144}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{z}}{-3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 95.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y))))
double code(double x, double y, double z, double t) {
	return x + ((0.3333333333333333 / z) * ((t / y) - y));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((0.3333333333333333d0 / z) * ((t / y) - y))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((0.3333333333333333 / z) * ((t / y) - y));
}
def code(x, y, z, t):
	return x + ((0.3333333333333333 / z) * ((t / y) - y))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)
\end{array}
Derivation
  1. Initial program 95.7%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Simplified95.3%

    \[\leadsto \color{blue}{x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)} \]
  3. Add Preprocessing
  4. Final simplification95.3%

    \[\leadsto x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right) \]
  5. Add Preprocessing

Alternative 22: 95.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ x + \frac{\frac{t}{y} - y}{z \cdot 3} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
	return x + (((t / y) - y) / (z * 3.0));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + (((t / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
	return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t):
	return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0)))
end
function tmp = code(x, y, z, t)
	tmp = x + (((t / y) - y) / (z * 3.0));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Derivation
  1. Initial program 95.7%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Step-by-step derivation
    1. associate-*l*95.7%

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
    2. *-commutative95.7%

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}} \]
  3. Simplified95.7%

    \[\leadsto \color{blue}{\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. *-commutative95.7%

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \color{blue}{\left(3 \cdot y\right)}} \]
    2. associate-*l*95.7%

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{\left(z \cdot 3\right) \cdot y}} \]
    3. associate-+l-95.7%

      \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    4. *-commutative95.7%

      \[\leadsto x - \left(\frac{y}{z \cdot 3} - \frac{t}{\color{blue}{y \cdot \left(z \cdot 3\right)}}\right) \]
    5. associate-/r*95.0%

      \[\leadsto x - \left(\frac{y}{z \cdot 3} - \color{blue}{\frac{\frac{t}{y}}{z \cdot 3}}\right) \]
    6. sub-div95.4%

      \[\leadsto x - \color{blue}{\frac{y - \frac{t}{y}}{z \cdot 3}} \]
  6. Applied egg-rr95.4%

    \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
  7. Final simplification95.4%

    \[\leadsto x + \frac{\frac{t}{y} - y}{z \cdot 3} \]
  8. Add Preprocessing

Alternative 23: 31.0% accurate, 15.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 95.7%

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Simplified95.3%

    \[\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 30.1%

    \[\leadsto \color{blue}{x} \]
  5. Final simplification30.1%

    \[\leadsto x \]
  6. Add Preprocessing

Developer target: 96.4% 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 2024011 
(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))))