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

Percentage Accurate: 95.5% → 95.5%
Time: 10.4s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 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.5% 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: 95.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 91.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq -4.2:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}\\

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

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    6. Taylor expanded in y around inf 96.2%

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

    if -1.56000000000000007e69 < y < -4.20000000000000018

    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. clear-num99.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{y \cdot z} - 0.3333333333333333 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. fma-neg95.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.3333333333333333, \frac{t}{y \cdot z}, -0.3333333333333333 \cdot \frac{y}{z}\right)} \]
      2. *-commutative95.0%

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{z \cdot y}} - 0.3333333333333333 \cdot \frac{y}{z} \]
      5. times-frac95.0%

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

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

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

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

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

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

    if -4.20000000000000018 < y < 1.25e-17

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{t \cdot 0.3333333333333333}}{z}}{y} + x \]
      3. /-rgt-identity94.6%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{t}{z \cdot 3}}}{y} + x \]
    9. Simplified94.8%

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

    if 1.25e-17 < y

    1. Initial program 97.2%

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

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

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

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

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

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

Alternative 3: 95.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 4: 89.4% accurate, 1.1× speedup?

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

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

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

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


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

    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. associate-*l*98.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    6. Taylor expanded in y around inf 89.3%

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

    if -6.9999999999999998e-9 < y < 0.068000000000000005

    1. Initial program 96.2%

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

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

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

    if 0.068000000000000005 < y

    1. Initial program 97.2%

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

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

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

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

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

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

Alternative 5: 89.4% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq 0.0112:\\
\;\;\;\;x + \frac{t}{3 \cdot \left(y \cdot z\right)}\\

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


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

    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. associate-*l*98.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    6. Taylor expanded in y around inf 89.3%

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

    if -7.4999999999999997e-8 < y < 0.0111999999999999999

    1. Initial program 96.2%

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{1 \cdot t}{\frac{z}{0.3333333333333333} \cdot y}} \]
      6. *-un-lft-identity94.9%

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

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

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

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

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

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

    if 0.0111999999999999999 < y

    1. Initial program 97.2%

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

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

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

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

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

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

Alternative 6: 89.4% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq 0.00016:\\
\;\;\;\;x + \frac{t}{z \cdot \left(y \cdot 3\right)}\\

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


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

    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. associate-*l*98.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    6. Taylor expanded in y around inf 89.3%

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

    if -5.2000000000000002e-8 < y < 1.60000000000000013e-4

    1. Initial program 96.2%

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{1 \cdot t}{\frac{z}{0.3333333333333333} \cdot y}} \]
      6. *-un-lft-identity94.9%

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

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

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

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

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

    if 1.60000000000000013e-4 < y

    1. Initial program 97.2%

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

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

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

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

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

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

Alternative 7: 92.0% accurate, 1.1× speedup?

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

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

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

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


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

    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. associate-*l*98.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    6. Taylor expanded in y around inf 89.3%

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

    if -1.18e-7 < y < 6.8999999999999996e-7

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.8999999999999996e-7 < y

    1. Initial program 97.2%

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

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

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

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

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

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

Alternative 8: 92.1% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq 0.145:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\

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


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

    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. associate-*l*98.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
    6. Taylor expanded in y around inf 89.3%

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

    if -3.19999999999999981e-10 < y < 0.14499999999999999

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{t \cdot 0.3333333333333333}}{z}}{y} + x \]
      3. /-rgt-identity95.3%

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{t}{z \cdot 3}}}{y} + x \]
    9. Simplified95.5%

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

    if 0.14499999999999999 < y

    1. Initial program 97.2%

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

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

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

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

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

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

Alternative 9: 95.4% 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 97.1%

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

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

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

Alternative 10: 95.5% 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 97.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
  6. Final simplification96.1%

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

Alternative 11: 47.6% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.38 \lor \neg \left(y \leq 1.62 \cdot 10^{-44}\right):\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.38 or 1.6200000000000001e-44 < y

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot -0.3333333333333333} \]
    7. Taylor expanded in y around 0 68.8%

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

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

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

        \[\leadsto \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      4. distribute-neg-frac68.8%

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

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

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

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

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

    if -0.38 < y < 1.6200000000000001e-44

    1. Initial program 96.2%

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

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

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.4%

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

Alternative 12: 47.6% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\

\mathbf{elif}\;y \leq 1.62 \cdot 10^{-44}:\\
\;\;\;\;x\\

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


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

    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. clear-num98.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
      2. clear-num70.8%

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y}}} \]
    8. Applied egg-rr70.8%

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

    if -6.5 < y < 1.6200000000000001e-44

    1. Initial program 96.2%

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

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

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

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

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

    if 1.6200000000000001e-44 < y

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot -0.3333333333333333} \]
    7. Taylor expanded in y around 0 66.6%

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

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{z} \cdot y} \]
      3. metadata-eval66.7%

        \[\leadsto \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      4. distribute-neg-frac66.7%

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

        \[\leadsto \color{blue}{y \cdot \left(-\frac{0.3333333333333333}{z}\right)} \]
      6. distribute-neg-frac66.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5:\\ \;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\ \mathbf{elif}\;y \leq 1.62 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]

Alternative 13: 47.6% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0105:\\
\;\;\;\;\frac{y}{z \cdot -3}\\

\mathbf{elif}\;y \leq 1.62 \cdot 10^{-44}:\\
\;\;\;\;x\\

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


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

    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. clear-num98.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-y\right) \cdot \frac{-0.3333333333333333}{-z}} \]
      4. clear-num70.7%

        \[\leadsto \left(-y\right) \cdot \color{blue}{\frac{1}{\frac{-z}{-0.3333333333333333}}} \]
      5. metadata-eval70.7%

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

        \[\leadsto \left(-y\right) \cdot \frac{1}{\color{blue}{\frac{z}{0.3333333333333333}}} \]
      7. div-inv70.7%

        \[\leadsto \left(-y\right) \cdot \frac{1}{\color{blue}{z \cdot \frac{1}{0.3333333333333333}}} \]
      8. metadata-eval70.7%

        \[\leadsto \left(-y\right) \cdot \frac{1}{z \cdot \color{blue}{3}} \]
      9. un-div-inv70.9%

        \[\leadsto \color{blue}{\frac{-y}{z \cdot 3}} \]
      10. add-sqr-sqrt70.7%

        \[\leadsto \frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z \cdot 3} \]
      11. sqrt-unprod46.2%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{z \cdot 3} \]
      12. sqr-neg46.2%

        \[\leadsto \frac{\sqrt{\color{blue}{y \cdot y}}}{z \cdot 3} \]
      13. sqrt-unprod0.0%

        \[\leadsto \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z \cdot 3} \]
      14. add-sqr-sqrt2.8%

        \[\leadsto \frac{\color{blue}{y}}{z \cdot 3} \]
      15. frac-2neg2.8%

        \[\leadsto \color{blue}{\frac{-y}{-z \cdot 3}} \]
      16. add-sqr-sqrt2.8%

        \[\leadsto \frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{-z \cdot 3} \]
      17. sqrt-unprod2.4%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{-z \cdot 3} \]
      18. sqr-neg2.4%

        \[\leadsto \frac{\sqrt{\color{blue}{y \cdot y}}}{-z \cdot 3} \]
      19. sqrt-unprod0.0%

        \[\leadsto \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{-z \cdot 3} \]
      20. add-sqr-sqrt70.9%

        \[\leadsto \frac{\color{blue}{y}}{-z \cdot 3} \]
      21. distribute-rgt-neg-in70.9%

        \[\leadsto \frac{y}{\color{blue}{z \cdot \left(-3\right)}} \]
      22. metadata-eval70.9%

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

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

    if -0.0105000000000000007 < y < 1.6200000000000001e-44

    1. Initial program 96.2%

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

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

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

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

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

    if 1.6200000000000001e-44 < y

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{z} \cdot -0.3333333333333333} \]
    7. Taylor expanded in y around 0 66.6%

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

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{z} \cdot y} \]
      3. metadata-eval66.7%

        \[\leadsto \frac{\color{blue}{-0.3333333333333333}}{z} \cdot y \]
      4. distribute-neg-frac66.7%

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

        \[\leadsto \color{blue}{y \cdot \left(-\frac{0.3333333333333333}{z}\right)} \]
      6. distribute-neg-frac66.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.0105:\\ \;\;\;\;\frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq 1.62 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]

Alternative 14: 64.4% 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 97.1%

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

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

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

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

    \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
  5. Final simplification63.6%

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

Alternative 15: 64.5% 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 97.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x - \frac{y - \frac{t}{y}}{z \cdot 3}} \]
  6. Taylor expanded in y around inf 63.6%

    \[\leadsto x - \frac{\color{blue}{y}}{z \cdot 3} \]
  7. Final simplification63.6%

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

Alternative 16: 64.4% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

Alternative 17: 30.2% 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 97.1%

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification26.0%

    \[\leadsto x \]

Developer target: 96.1% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2023340 
(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))))