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

Percentage Accurate: 95.6% → 99.5%
Time: 8.1s
Alternatives: 11
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 3) < -1e12 or 1.00000000000000007e-37 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      9. associate-*l*99.8%

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

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

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

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

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

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

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

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

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

    if -1e12 < (*.f64 z 3) < 1.00000000000000007e-37

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)} \leq -\infty:\\ \;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + \frac{t}{z \cdot \left(y \cdot 3\right)}\right) + \frac{y}{z \cdot -3}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) (- INFINITY))
   (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y)))
   (+ (+ x (/ t (* z (* y 3.0)))) (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= -((double) INFINITY)) {
		tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
	} else {
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= -Double.POSITIVE_INFINITY) {
		tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
	} else {
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= -math.inf:
		tmp = x + ((0.3333333333333333 / z) * ((t / y) - y))
	else:
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) <= Float64(-Inf))
		tmp = Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y)));
	else
		tmp = Float64(Float64(x + Float64(t / Float64(z * Float64(y * 3.0)))) + Float64(y / Float64(z * -3.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))) <= -Inf)
		tmp = x + ((0.3333333333333333 / z) * ((t / y) - y));
	else
		tmp = (x + (t / (z * (y * 3.0)))) + (y / (z * -3.0));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) < -inf.0

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y)))

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.3% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{-1 \cdot \frac{y}{z \cdot 3}} \]
      5. neg-mul-199.9%

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

        \[\leadsto x + \color{blue}{\frac{y}{-z \cdot 3}} \]
      7. distribute-rgt-neg-in99.9%

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

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

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

    if -3.39999999999999997e77 < y < 3.1e-7

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1e-7 < y

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{3 \cdot z}} \]
      3. neg-mul-194.1%

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

        \[\leadsto x + \color{blue}{\frac{\frac{-y}{z}}{3}} \]
      5. frac-2neg94.2%

        \[\leadsto x + \color{blue}{\frac{-\frac{-y}{z}}{-3}} \]
      6. distribute-frac-neg294.2%

        \[\leadsto x + \frac{\color{blue}{\frac{-y}{-z}}}{-3} \]
      7. frac-2neg94.2%

        \[\leadsto x + \frac{\color{blue}{\frac{y}{z}}}{-3} \]
      8. metadata-eval94.2%

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

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

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

Alternative 4: 88.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 110:\\
\;\;\;\;x + \frac{0.3333333333333333}{z} \cdot \frac{t}{y}\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{-1 \cdot \frac{y}{z \cdot 3}} \]
      5. neg-mul-199.9%

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

        \[\leadsto x + \color{blue}{\frac{y}{-z \cdot 3}} \]
      7. distribute-rgt-neg-in99.9%

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

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

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

    if -3.39999999999999997e77 < y < 110

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 110 < y

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{3 \cdot z}} \]
      3. neg-mul-194.1%

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

        \[\leadsto x + \color{blue}{\frac{\frac{-y}{z}}{3}} \]
      5. frac-2neg94.2%

        \[\leadsto x + \color{blue}{\frac{-\frac{-y}{z}}{-3}} \]
      6. distribute-frac-neg294.2%

        \[\leadsto x + \frac{\color{blue}{\frac{-y}{-z}}}{-3} \]
      7. frac-2neg94.2%

        \[\leadsto x + \frac{\color{blue}{\frac{y}{z}}}{-3} \]
      8. metadata-eval94.2%

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

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

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

Alternative 5: 91.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{-1 \cdot \frac{y}{z \cdot 3}} \]
      5. neg-mul-199.9%

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

        \[\leadsto x + \color{blue}{\frac{y}{-z \cdot 3}} \]
      7. distribute-rgt-neg-in99.9%

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

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

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

    if -3.39999999999999997e77 < y < 2.99999999999999973e-8

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{1}{z} \cdot \frac{\frac{t}{y} - y}{3}} \]
    9. Taylor expanded in t around inf 87.7%

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

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

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

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

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

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

    if 2.99999999999999973e-8 < y

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{3 \cdot z}} \]
      3. neg-mul-194.1%

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

        \[\leadsto x + \color{blue}{\frac{\frac{-y}{z}}{3}} \]
      5. frac-2neg94.2%

        \[\leadsto x + \color{blue}{\frac{-\frac{-y}{z}}{-3}} \]
      6. distribute-frac-neg294.2%

        \[\leadsto x + \frac{\color{blue}{\frac{-y}{-z}}}{-3} \]
      7. frac-2neg94.2%

        \[\leadsto x + \frac{\color{blue}{\frac{y}{z}}}{-3} \]
      8. metadata-eval94.2%

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

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

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

Alternative 6: 95.8% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 95.8% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 64.3% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x + \frac{y}{z} \cdot -0.3333333333333333 \]
  7. Add Preprocessing

Alternative 9: 64.4% 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 95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{-1}{3}} \cdot \frac{y}{z} \]
    2. times-frac66.7%

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

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

      \[\leadsto x + \color{blue}{-1 \cdot \frac{y}{z \cdot 3}} \]
    5. neg-mul-166.7%

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

      \[\leadsto x + \color{blue}{\frac{y}{-z \cdot 3}} \]
    7. distribute-rgt-neg-in66.7%

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

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

    \[\leadsto x + \color{blue}{\frac{y}{z \cdot -3}} \]
  8. Final simplification66.7%

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

Alternative 10: 64.3% accurate, 2.1× speedup?

\[\begin{array}{l} \\ x + \frac{\frac{y}{z}}{-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(Float64(y / 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[(N[(y / z), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{-1}{3}} \cdot \frac{y}{z} \]
    2. times-frac66.7%

      \[\leadsto x + \color{blue}{\frac{-1 \cdot y}{3 \cdot z}} \]
    3. neg-mul-166.7%

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

      \[\leadsto x + \color{blue}{\frac{\frac{-y}{z}}{3}} \]
    5. frac-2neg66.7%

      \[\leadsto x + \color{blue}{\frac{-\frac{-y}{z}}{-3}} \]
    6. distribute-frac-neg266.7%

      \[\leadsto x + \frac{\color{blue}{\frac{-y}{-z}}}{-3} \]
    7. frac-2neg66.7%

      \[\leadsto x + \frac{\color{blue}{\frac{y}{z}}}{-3} \]
    8. metadata-eval66.7%

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

    \[\leadsto x + \color{blue}{\frac{\frac{y}{z}}{-3}} \]
  8. Final simplification66.7%

    \[\leadsto x + \frac{\frac{y}{z}}{-3} \]
  9. Add Preprocessing

Alternative 11: 30.6% accurate, 15.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification36.7%

    \[\leadsto x \]
  7. Add Preprocessing

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

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

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