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

Percentage Accurate: 95.8% → 97.1%
Time: 15.4s
Alternatives: 14
Speedup: 0.8×

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 14 alternatives:

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

Initial Program: 95.8% accurate, 1.0× speedup?

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

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

Alternative 1: 97.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 91.8%

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

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

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

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

    if 2.0000000000000002e-195 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

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

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

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

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

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

Alternative 2: 80.4% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 3) < -46000 or 1.99999999999999991e158 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

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

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

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

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

    if -46000 < (*.f64 z 3) < 1.99999999999999991e158

    1. Initial program 92.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{y \cdot z} \cdot 0.3333333333333333} - 0.3333333333333333 \cdot \frac{y}{z} \]
      2. *-commutative80.5%

        \[\leadsto \frac{t}{\color{blue}{z \cdot y}} \cdot 0.3333333333333333 - 0.3333333333333333 \cdot \frac{y}{z} \]
      3. *-commutative80.5%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{z \cdot y}} - 0.3333333333333333 \cdot \frac{y}{z} \]
      4. *-commutative80.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 60.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+145}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq -7.2 \cdot 10^{-18}:\\
\;\;\;\;x\\

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative90.4%

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

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

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

    if -2.7999999999999999e145 < y < -7.20000000000000021e-18

    1. Initial program 97.2%

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

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

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

    if -7.20000000000000021e-18 < y < 8.5e-17

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{z \cdot y}} - 0.3333333333333333 \cdot \frac{y}{z} \]
      4. *-commutative62.2%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}{z} \]
    7. Simplified64.0%

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

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

    if 8.5e-17 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{y \cdot z} \cdot 0.3333333333333333} - 0.3333333333333333 \cdot \frac{y}{z} \]
      2. *-commutative72.0%

        \[\leadsto \frac{t}{\color{blue}{z \cdot y}} \cdot 0.3333333333333333 - 0.3333333333333333 \cdot \frac{y}{z} \]
      3. *-commutative72.0%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{z \cdot y}} - 0.3333333333333333 \cdot \frac{y}{z} \]
      4. *-commutative72.0%

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

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

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

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

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

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

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

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

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

Alternative 4: 62.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+145}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq -1.15 \cdot 10^{-18}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{-16}:\\
\;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative90.4%

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

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

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

    if -2.7999999999999999e145 < y < -1.15e-18

    1. Initial program 97.2%

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

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

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

    if -1.15e-18 < y < 1.20000000000000002e-16

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{z \cdot y}} - 0.3333333333333333 \cdot \frac{y}{z} \]
      4. *-commutative62.2%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}{z} \]
    7. Simplified64.0%

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} \]
      2. times-frac65.1%

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{y} \cdot \frac{t}{z}} \]
      3. *-commutative65.1%

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    10. Simplified65.1%

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

    if 1.20000000000000002e-16 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{y \cdot z} \cdot 0.3333333333333333} - 0.3333333333333333 \cdot \frac{y}{z} \]
      2. *-commutative72.0%

        \[\leadsto \frac{t}{\color{blue}{z \cdot y}} \cdot 0.3333333333333333 - 0.3333333333333333 \cdot \frac{y}{z} \]
      3. *-commutative72.0%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{z \cdot y}} - 0.3333333333333333 \cdot \frac{y}{z} \]
      4. *-commutative72.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{+145}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq -1.15 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-16}:\\ \;\;\;\;\frac{t}{z} \cdot \frac{0.3333333333333333}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\ \end{array} \]

Alternative 5: 88.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+22} \lor \neg \left(y \leq 9 \cdot 10^{-28}\right):\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.2000000000000004e22 or 8.9999999999999996e-28 < y

    1. Initial program 99.1%

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

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

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

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

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

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

    if -6.2000000000000004e22 < y < 8.9999999999999996e-28

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

Alternative 6: 88.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+22} \lor \neg \left(y \leq 9 \cdot 10^{-28}\right):\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8e22 or 8.9999999999999996e-28 < y

    1. Initial program 99.1%

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

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

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

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

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

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

    if -2.8e22 < y < 8.9999999999999996e-28

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 88.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+22} \lor \neg \left(y \leq 7.2 \cdot 10^{-28}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.2000000000000004e22 or 7.1999999999999997e-28 < y

    1. Initial program 99.1%

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{\color{blue}{-1}}{-\frac{z}{-0.3333333333333333}} \]
      5. distribute-neg-frac89.0%

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

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

        \[\leadsto x + y \cdot \frac{-1}{\color{blue}{\frac{z}{0.3333333333333333}}} \]
      8. associate-*r/89.1%

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

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

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

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

    if -6.2000000000000004e22 < y < 7.1999999999999997e-28

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 95.7% accurate, 1.2× speedup?

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

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

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

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

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

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

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

Alternative 9: 78.3% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-36} \lor \neg \left(y \leq 2.05 \cdot 10^{-67}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.80000000000000026e-36 or 2.0499999999999999e-67 < y

    1. Initial program 97.9%

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

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

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

    if -5.80000000000000026e-36 < y < 2.0499999999999999e-67

    1. Initial program 90.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{y \cdot z} \cdot 0.3333333333333333} - 0.3333333333333333 \cdot \frac{y}{z} \]
      2. *-commutative65.5%

        \[\leadsto \frac{t}{\color{blue}{z \cdot y}} \cdot 0.3333333333333333 - 0.3333333333333333 \cdot \frac{y}{z} \]
      3. *-commutative65.5%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{z \cdot y}} - 0.3333333333333333 \cdot \frac{y}{z} \]
      4. *-commutative65.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} \]
      2. times-frac69.7%

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    10. Simplified69.7%

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

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

Alternative 10: 78.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-35} \lor \neg \left(y \leq 1.16 \cdot 10^{-68}\right):\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5999999999999998e-35 or 1.1599999999999999e-68 < y

    1. Initial program 97.9%

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

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

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

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

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

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

    if -4.5999999999999998e-35 < y < 1.1599999999999999e-68

    1. Initial program 90.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{y \cdot z} \cdot 0.3333333333333333} - 0.3333333333333333 \cdot \frac{y}{z} \]
      2. *-commutative65.5%

        \[\leadsto \frac{t}{\color{blue}{z \cdot y}} \cdot 0.3333333333333333 - 0.3333333333333333 \cdot \frac{y}{z} \]
      3. *-commutative65.5%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{z \cdot y}} - 0.3333333333333333 \cdot \frac{y}{z} \]
      4. *-commutative65.5%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot t}{y \cdot z}} \]
      2. times-frac69.7%

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \frac{0.3333333333333333}{y}} \]
    10. Simplified69.7%

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

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

Alternative 11: 95.7% accurate, 1.4× speedup?

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

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

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

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

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

Alternative 12: 46.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+111}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{+146}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.4000000000000005e111 or 5.7999999999999997e146 < z

    1. Initial program 99.8%

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

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

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

    if -7.4000000000000005e111 < z < 5.7999999999999997e146

    1. Initial program 92.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative45.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.4 \cdot 10^{+111}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+146}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 13: 46.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+111}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.9 \cdot 10^{+146}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.25e111 or 3.9e146 < z

    1. Initial program 99.8%

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

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

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

    if -2.25e111 < z < 3.9e146

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t}{\color{blue}{z \cdot y}} \cdot 0.3333333333333333 - 0.3333333333333333 \cdot \frac{y}{z} \]
      3. *-commutative79.6%

        \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{t}{z \cdot y}} - 0.3333333333333333 \cdot \frac{y}{z} \]
      4. *-commutative79.6%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}}{z} \]
    7. Simplified84.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+111}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+146}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 14: 30.7% accurate, 15.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification30.7%

    \[\leadsto x \]

Developer target: 96.5% 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 2023279 
(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))))