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

Percentage Accurate: 95.1% → 97.2%
Time: 7.6s
Alternatives: 9
Speedup: 1.1×

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 9 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.1% 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.2% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 98.8%

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

    if -4.99999999999999979e-104 < (*.f64 z 3)

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

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      2. sub-neg91.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-neg91.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-in91.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-neg91.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-191.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/91.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/91.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-frac91.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-191.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-frac99.1%

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

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

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

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

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

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

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

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

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

Alternative 2: 92.8% accurate, 1.1× speedup?

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

\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.40000000000000009e46 or 1.95e31 < y

    1. Initial program 97.2%

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

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

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

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

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

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

        \[\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/97.2%

        \[\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/97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
    8. Simplified94.5%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
    9. Taylor expanded in z around 0 94.7%

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

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

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

    if -1.40000000000000009e46 < y < 1.95e31

    1. Initial program 92.3%

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

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

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

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

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

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

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

        \[\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/92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{0.3333333333333333 \cdot \frac{t}{z}}}{y} \]
      8. *-un-lft-identity93.5%

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

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

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

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

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

Alternative 3: 92.8% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.0000000000000001e47 or 1.15e31 < y

    1. Initial program 97.2%

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

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

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

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

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

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

        \[\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/97.2%

        \[\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/97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
    8. Simplified94.5%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
    9. Taylor expanded in z around 0 94.7%

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

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

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

    if -2.0000000000000001e47 < y < 1.15e31

    1. Initial program 92.3%

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

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

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

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

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

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

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

        \[\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/92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 95.3% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.19999999999999994e244

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\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/99.8%

        \[\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/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{t}{\frac{y}{0.3333333333333333} \cdot z}} \]
    11. Taylor expanded in y around 0 95.3%

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

    if -1.19999999999999994e244 < z

    1. Initial program 93.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-93.9%

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      2. sub-neg93.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-neg93.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-in93.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-neg93.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-193.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/93.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/93.8%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 95.3% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.40000000000000033e243

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\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/99.8%

        \[\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/99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{t}{\frac{y}{0.3333333333333333} \cdot z}} \]
    11. Taylor expanded in y around 0 95.3%

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

    if -6.40000000000000033e243 < z

    1. Initial program 93.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-93.9%

        \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
      2. sub-neg93.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-neg93.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-in93.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-neg93.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-193.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/93.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/93.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 62.9% 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 94.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-94.4%

      \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    2. sub-neg94.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-neg94.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-in94.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-neg94.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-194.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/94.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/94.3%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y}}} \]
  8. Simplified64.1%

    \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y}}} \]
  9. Step-by-step derivation
    1. associate-/r/64.0%

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

    \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{z} \cdot y} \]
  11. Final simplification64.0%

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

Alternative 7: 62.9% accurate, 2.1× speedup?

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

\\
x + \frac{-0.3333333333333333}{\frac{z}{y}}
\end{array}
Derivation
  1. Initial program 94.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-94.4%

      \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    2. sub-neg94.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-neg94.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-in94.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-neg94.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-194.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/94.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/94.3%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y}}} \]
  8. Simplified64.1%

    \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y}}} \]
  9. Final simplification64.1%

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

Alternative 8: 63.0% 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 94.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-94.4%

      \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    2. sub-neg94.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-neg94.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-in94.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-neg94.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-194.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/94.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/94.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
  8. Simplified64.1%

    \[\leadsto x + \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
  9. Taylor expanded in z around 0 64.1%

    \[\leadsto x + \frac{y}{\color{blue}{-3 \cdot z}} \]
  10. Step-by-step derivation
    1. *-commutative64.1%

      \[\leadsto x + \frac{y}{\color{blue}{z \cdot -3}} \]
  11. Simplified64.1%

    \[\leadsto x + \frac{y}{\color{blue}{z \cdot -3}} \]
  12. Final simplification64.1%

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

Alternative 9: 30.1% accurate, 15.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 94.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-94.4%

      \[\leadsto \color{blue}{x - \left(\frac{y}{z \cdot 3} - \frac{t}{\left(z \cdot 3\right) \cdot y}\right)} \]
    2. sub-neg94.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-neg94.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-in94.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-neg94.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-194.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/94.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/94.3%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification32.7%

    \[\leadsto x \]

Developer target: 96.1% 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 2023207 
(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))))