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

Percentage Accurate: 95.8% → 97.5%
Time: 9.2s
Alternatives: 10
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 95.8% accurate, 1.0× speedup?

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

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

Alternative 1: 97.5% accurate, 0.4× speedup?

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

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

\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 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y))) < 1.99999999999999989e273

    1. Initial program 98.8%

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

    if 1.99999999999999989e273 < (+.f64 (-.f64 x (/.f64 y (*.f64 z 3))) (/.f64 t (*.f64 (*.f64 z 3) y)))

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.4% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.79999999999999982 or 5.19999999999999994e64 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y}{z} \]
      2. cancel-sign-sub-inv97.5%

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

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

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

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

        \[\leadsto x - \left(-\color{blue}{\frac{-0.3333333333333333}{z} \cdot y}\right) \]
      7. *-commutative97.5%

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

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

        \[\leadsto x - y \cdot \color{blue}{\frac{--0.3333333333333333}{z}} \]
      10. metadata-eval97.5%

        \[\leadsto x - y \cdot \frac{\color{blue}{0.3333333333333333}}{z} \]
    7. Simplified97.5%

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

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

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

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

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

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

    if -6.79999999999999982 < y < 5.19999999999999994e64

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.6% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.5 or 5.60000000000000047e64 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y}{z} \]
      2. cancel-sign-sub-inv97.5%

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

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

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

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

        \[\leadsto x - \left(-\color{blue}{\frac{-0.3333333333333333}{z} \cdot y}\right) \]
      7. *-commutative97.5%

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

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

        \[\leadsto x - y \cdot \color{blue}{\frac{--0.3333333333333333}{z}} \]
      10. metadata-eval97.5%

        \[\leadsto x - y \cdot \frac{\color{blue}{0.3333333333333333}}{z} \]
    7. Simplified97.5%

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

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

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

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

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

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

    if -3.5 < y < 5.60000000000000047e64

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 88.6% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -13.5 or 5.19999999999999994e64 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y}{z} \]
      2. cancel-sign-sub-inv97.5%

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

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

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

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

        \[\leadsto x - \left(-\color{blue}{\frac{-0.3333333333333333}{z} \cdot y}\right) \]
      7. *-commutative97.5%

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

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

        \[\leadsto x - y \cdot \color{blue}{\frac{--0.3333333333333333}{z}} \]
      10. metadata-eval97.5%

        \[\leadsto x - y \cdot \frac{\color{blue}{0.3333333333333333}}{z} \]
    7. Simplified97.5%

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

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

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

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

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

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

    if -13.5 < y < 5.19999999999999994e64

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 95.9% 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 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 64.2% accurate, 2.1× speedup?

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

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

    \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
  2. Add Preprocessing
  3. Taylor expanded in t around 0 60.8%

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

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

Alternative 9: 64.3% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y}{z} \]
    2. cancel-sign-sub-inv60.8%

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

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

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

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

      \[\leadsto x - \left(-\color{blue}{\frac{-0.3333333333333333}{z} \cdot y}\right) \]
    7. *-commutative60.8%

      \[\leadsto x - \left(-\color{blue}{y \cdot \frac{-0.3333333333333333}{z}}\right) \]
    8. distribute-rgt-neg-in60.8%

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

      \[\leadsto x - y \cdot \color{blue}{\frac{--0.3333333333333333}{z}} \]
    10. metadata-eval60.8%

      \[\leadsto x - y \cdot \frac{\color{blue}{0.3333333333333333}}{z} \]
  7. Simplified60.8%

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

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

      \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{0.3333333333333333}}} \]
    3. div-inv60.9%

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

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

    \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
  10. Final simplification60.9%

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

Alternative 10: 30.1% accurate, 15.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification30.2%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 95.9% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024034 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

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

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