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

Percentage Accurate: 95.3% → 97.7%
Time: 8.2s
Alternatives: 10
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 10 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 97.7% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 96.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-/r*98.1%

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-22 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 62.5% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq -3.7 \cdot 10^{-18}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 6 \cdot 10^{-122}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.02 \cdot 10^{-48}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4800000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2 \cdot 10^{+60}:\\
\;\;\;\;x\\

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


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

    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-/r*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
    11. Applied egg-rr80.3%

      \[\leadsto \color{blue}{y \cdot \frac{-0.3333333333333333}{z}} \]
    12. Step-by-step derivation
      1. clear-num80.3%

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

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

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

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

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

    if -9.4999999999999997e115 < y < -3.7000000000000003e-18 or 6.00000000000000009e-122 < y < 1.02000000000000005e-48 or 4.8e9 < y < 1.9999999999999999e60

    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-/r*99.8%

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

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

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

    if -3.7000000000000003e-18 < y < 6.00000000000000009e-122 or 1.02000000000000005e-48 < y < 4.8e9

    1. Initial program 93.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-/r*96.7%

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub70.0%

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e60 < y

    1. Initial program 95.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-/r*91.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+115}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq -3.7 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-122}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{-48}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4800000000:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+60}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \end{array} \]

Alternative 3: 45.5% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x \leq -1.6 \cdot 10^{+119} \lor \neg \left(x \leq -53\right) \land x \leq 1.05 \cdot 10^{-58}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.2999999999999999e140 or -1.59999999999999995e119 < x < -53 or 1.04999999999999994e-58 < x

    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-/r*99.0%

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

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

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

    if -2.2999999999999999e140 < x < -1.59999999999999995e119 or -53 < x < 1.04999999999999994e-58

    1. Initial program 94.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-/r*95.1%

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub87.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{z}{-0.3333333333333333}}} \]
      3. clear-num51.4%

        \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
    11. Applied egg-rr51.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+140}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{+119} \lor \neg \left(x \leq -53\right) \land x \leq 1.05 \cdot 10^{-58}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 4: 45.6% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;x \leq -40:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.2999999999999999e140 or -4.60000000000000032e118 < x < -40 or 1.04999999999999994e-58 < x

    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-/r*99.0%

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

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

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

    if -2.2999999999999999e140 < x < -4.60000000000000032e118

    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-/r*99.8%

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

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

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

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

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

    if -40 < x < 1.04999999999999994e-58

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
    11. Applied egg-rr50.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+140}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -4.6 \cdot 10^{+118}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;x \leq -40:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-58}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 5: 45.5% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;x \leq -55:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.05 \cdot 10^{-58}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.2999999999999999e140 or -7.0999999999999997e118 < x < -55 or 1.04999999999999994e-58 < x

    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-/r*99.0%

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

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

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

    if -2.2999999999999999e140 < x < -7.0999999999999997e118

    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-/r*99.8%

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

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

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

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

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

    if -55 < x < 1.04999999999999994e-58

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-0.3333333333333333}{z}} \]
    11. Applied egg-rr50.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+140}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq -7.1 \cdot 10^{+118}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;x \leq -55:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-58}:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 88.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+44} \lor \neg \left(y \leq 1.7 \cdot 10^{+53}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.19999999999999996e44 or 1.69999999999999999e53 < y

    1. Initial program 98.0%

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

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

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

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

    if -2.19999999999999996e44 < y < 1.69999999999999999e53

    1. Initial program 95.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+44} \lor \neg \left(y \leq 1.7 \cdot 10^{+53}\right):\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \end{array} \]

Alternative 7: 77.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-31} \lor \neg \left(y \leq 6 \cdot 10^{-122}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.99999999999999962e-31 or 6.00000000000000009e-122 < y

    1. Initial program 98.6%

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

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

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

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

    if -5.99999999999999962e-31 < y < 6.00000000000000009e-122

    1. Initial program 92.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-/r*96.3%

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub68.6%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{-31} \lor \neg \left(y \leq 6 \cdot 10^{-122}\right):\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \end{array} \]

Alternative 8: 77.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{-32} \lor \neg \left(y \leq 6 \cdot 10^{-122}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.08e-32 or 6.00000000000000009e-122 < y

    1. Initial program 98.6%

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

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

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

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

    if -1.08e-32 < y < 6.00000000000000009e-122

    1. Initial program 92.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-/r*96.3%

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333 \cdot \frac{t}{y}}{z} - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. div-sub68.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    12. Step-by-step derivation
      1. clear-num73.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.08 \cdot 10^{-32} \lor \neg \left(y \leq 6 \cdot 10^{-122}\right):\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\ \end{array} \]

Alternative 9: 95.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ x + \frac{-0.3333333333333333}{z} \cdot \left(y - \frac{t}{y}\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* (/ -0.3333333333333333 z) (- y (/ t y)))))
double code(double x, double y, double z, double t) {
	return x + ((-0.3333333333333333 / z) * (y - (t / 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) * (y - (t / y)))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((-0.3333333333333333 / z) * (y - (t / y)));
}
def code(x, y, z, t):
	return x + ((-0.3333333333333333 / z) * (y - (t / y)))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(-0.3333333333333333 / z) * Float64(y - Float64(t / y))))
end
function tmp = code(x, y, z, t)
	tmp = x + ((-0.3333333333333333 / z) * (y - (t / y)));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(-0.3333333333333333 / z), $MachinePrecision] * N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 29.6% 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 96.4%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification30.1%

    \[\leadsto x \]

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 2023173 
(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))))