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

Percentage Accurate: 95.2% → 97.8%
Time: 9.1s
Alternatives: 11
Speedup: 1.0×

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 11 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.2% 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.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 2.35 \cdot 10^{-167}:\\
\;\;\;\;x + \frac{1}{\frac{y}{\frac{t}{z} \cdot 0.3333333333333333}}\\

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


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

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\frac{y}{z} - \color{blue}{\frac{\frac{t}{y}}{z}}}{3} \]
      7. div-sub99.8%

        \[\leadsto x - \frac{\color{blue}{\frac{y - \frac{t}{y}}{z}}}{3} \]
      8. associate-/r*99.8%

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

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

    if -1.07999999999999995e-88 < y < 2.34999999999999985e-167

    1. Initial program 90.0%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{--0.3333333333333333 \cdot t}}{y \cdot z} \]
      4. distribute-frac-neg89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + {\left(\frac{\color{blue}{\frac{y}{\frac{t}{z}}}}{0.3333333333333333}\right)}^{-1} \]
      4. associate-/l/98.5%

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

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

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

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

    if 2.34999999999999985e-167 < y

    1. Initial program 93.5%

      \[\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(y - \frac{t}{y}\right)} \]
    3. Step-by-step derivation
      1. associate-*l/99.7%

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

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

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

Alternative 2: 95.9% accurate, 0.9× speedup?

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

\\
x + \left(\left(-0.3333333333333333 \cdot \frac{t}{z}\right) \cdot \frac{-1}{y} - \frac{y}{z \cdot 3}\right)
\end{array}
Derivation
  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-+l-93.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-87} \lor \neg \left(y \leq 1.6 \cdot 10^{-158}\right):\\
\;\;\;\;x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.4e-87 or 1.59999999999999998e-158 < y

    1. Initial program 95.1%

      \[\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(y - \frac{t}{y}\right)} \]

    if -1.4e-87 < y < 1.59999999999999998e-158

    1. Initial program 90.0%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{--0.3333333333333333 \cdot t}}{y \cdot z} \]
      4. distribute-frac-neg89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{\frac{t}{z}}{y}} \cdot 0.3333333333333333 \]
    7. Applied egg-rr98.4%

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

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

Alternative 4: 97.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-86} \lor \neg \left(y \leq 1.5 \cdot 10^{-158}\right):\\
\;\;\;\;x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1e-86 or 1.5e-158 < y

    1. Initial program 95.1%

      \[\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(y - \frac{t}{y}\right)} \]

    if -2.1e-86 < y < 1.5e-158

    1. Initial program 90.0%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{--0.3333333333333333 \cdot t}}{y \cdot z} \]
      4. distribute-frac-neg89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + {\left(\frac{\color{blue}{\frac{y}{\frac{t}{z}}}}{0.3333333333333333}\right)}^{-1} \]
      4. associate-/l/98.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-86} \lor \neg \left(y \leq 1.5 \cdot 10^{-158}\right):\\ \;\;\;\;x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{y}{\frac{t}{z} \cdot 0.3333333333333333}}\\ \end{array} \]

Alternative 5: 97.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 97.3%

      \[\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(y - \frac{t}{y}\right)} \]

    if -3.80000000000000011e-88 < y < 1.1000000000000001e-158

    1. Initial program 90.0%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{--0.3333333333333333 \cdot t}}{y \cdot z} \]
      4. distribute-frac-neg89.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + {\left(\frac{\color{blue}{\frac{y}{\frac{t}{z}}}}{0.3333333333333333}\right)}^{-1} \]
      4. associate-/l/98.5%

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

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

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

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

    if 1.1000000000000001e-158 < y

    1. Initial program 93.5%

      \[\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(y - \frac{t}{y}\right)} \]
    3. Step-by-step derivation
      1. associate-*l/99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{-88}:\\ \;\;\;\;x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-158}:\\ \;\;\;\;x + \frac{1}{\frac{y}{\frac{t}{z} \cdot 0.3333333333333333}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}\\ \end{array} \]

Alternative 6: 95.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 7: 89.4% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 98.1%

      \[\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(y - \frac{t}{y}\right)} \]
    3. Taylor expanded in y around inf 94.6%

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

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

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

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

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

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

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

    if -1900 < y < 6.7999999999999996e-17

    1. Initial program 89.6%

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

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

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

    if 6.7999999999999996e-17 < y

    1. Initial program 97.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1900:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-17}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]

Alternative 8: 91.9% accurate, 1.1× speedup?

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

\mathbf{elif}\;y \leq 2.8 \cdot 10^{-17}:\\
\;\;\;\;x + 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 < -1950

    1. Initial program 98.1%

      \[\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(y - \frac{t}{y}\right)} \]
    3. Taylor expanded in y around inf 94.6%

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

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

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

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

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

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

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

    if -1950 < y < 2.7999999999999999e-17

    1. Initial program 89.6%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{--0.3333333333333333 \cdot t}}{y \cdot z} \]
      4. distribute-frac-neg85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.7999999999999999e-17 < y

    1. Initial program 97.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1950:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-17}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]

Alternative 9: 63.3% accurate, 2.1× speedup?

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

\\
x + y \cdot \frac{-0.3333333333333333}{z}
\end{array}
Derivation
  1. Initial program 93.5%

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

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

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

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

Alternative 10: 63.3% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto x + \frac{y}{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}} \]
    5. metadata-eval60.2%

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

    \[\leadsto x + \color{blue}{\frac{y}{z \cdot -3}} \]
  6. Final simplification60.2%

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

Alternative 11: 29.7% 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 93.5%

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification25.9%

    \[\leadsto x \]

Developer target: 95.9% 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 2023310 
(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))))