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

Percentage Accurate: 95.7% → 97.8%
Time: 9.5s
Alternatives: 16
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 16 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.7% 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.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 10^{+44}:\\ \;\;\;\;\left(\frac{0.3333333333333333}{y} \cdot \frac{t}{z} + x\right) + \frac{y}{z \cdot -3}\\ \mathbf{else}:\\ \;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \left(y \cdot 3\right)}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t 1e+44)
   (+ (+ (* (/ 0.3333333333333333 y) (/ t z)) x) (/ y (* z -3.0)))
   (+ x (fma -0.3333333333333333 (/ y z) (/ t (* z (* y 3.0)))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1e+44) {
		tmp = (((0.3333333333333333 / y) * (t / z)) + x) + (y / (z * -3.0));
	} else {
		tmp = x + fma(-0.3333333333333333, (y / z), (t / (z * (y * 3.0))));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 1e+44)
		tmp = Float64(Float64(Float64(Float64(0.3333333333333333 / y) * Float64(t / z)) + x) + Float64(y / Float64(z * -3.0)));
	else
		tmp = Float64(x + fma(-0.3333333333333333, Float64(y / z), Float64(t / Float64(z * Float64(y * 3.0)))));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[t, 1e+44], N[(N[(N[(N[(0.3333333333333333 / y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.0000000000000001e44

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0000000000000001e44 < t

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 78.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+237} \lor \neg \left(z \cdot 3 \leq -4 \cdot 10^{+158} \lor \neg \left(z \cdot 3 \leq -5 \cdot 10^{+82}\right) \land z \cdot 3 \leq 2 \cdot 10^{+38}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z #s(literal 3 binary64)) < -9.9999999999999994e236 or -3.99999999999999981e158 < (*.f64 z #s(literal 3 binary64)) < -5.00000000000000015e82 or 1.99999999999999995e38 < (*.f64 z #s(literal 3 binary64))

    1. Initial program 99.8%

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

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

    if -9.9999999999999994e236 < (*.f64 z #s(literal 3 binary64)) < -3.99999999999999981e158 or -5.00000000000000015e82 < (*.f64 z #s(literal 3 binary64)) < 1.99999999999999995e38

    1. Initial program 91.0%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Step-by-step derivation
      1. distribute-lft-out--86.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+237} \lor \neg \left(z \cdot 3 \leq -4 \cdot 10^{+158} \lor \neg \left(z \cdot 3 \leq -5 \cdot 10^{+82}\right) \land z \cdot 3 \leq 2 \cdot 10^{+38}\right):\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 78.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+237} \lor \neg \left(z \cdot 3 \leq -4 \cdot 10^{+158} \lor \neg \left(z \cdot 3 \leq -5 \cdot 10^{+82}\right) \land z \cdot 3 \leq 2 \cdot 10^{+38}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z #s(literal 3 binary64)) < -9.9999999999999994e236 or -3.99999999999999981e158 < (*.f64 z #s(literal 3 binary64)) < -5.00000000000000015e82 or 1.99999999999999995e38 < (*.f64 z #s(literal 3 binary64))

    1. Initial program 99.8%

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

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

    if -9.9999999999999994e236 < (*.f64 z #s(literal 3 binary64)) < -3.99999999999999981e158 or -5.00000000000000015e82 < (*.f64 z #s(literal 3 binary64)) < 1.99999999999999995e38

    1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(\frac{t}{y} - y\right) \cdot 0.3333333333333333\right)} \cdot \frac{1}{z} \]
      8. associate-*l*86.7%

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

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

        \[\leadsto \left(\frac{t}{y} - y\right) \cdot \frac{\color{blue}{0.3333333333333333}}{z} \]
    9. Simplified86.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+237} \lor \neg \left(z \cdot 3 \leq -4 \cdot 10^{+158} \lor \neg \left(z \cdot 3 \leq -5 \cdot 10^{+82}\right) \land z \cdot 3 \leq 2 \cdot 10^{+38}\right):\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{t}{y} - y\right) \cdot \frac{0.3333333333333333}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 86.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{0.3333333333333333}{\frac{y \cdot z}{t}}\\ t_2 := x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{if}\;y \leq -0.00055:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.28 \cdot 10^{-123}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-291}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+39}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (/ 0.3333333333333333 (/ (* y z) t))))
        (t_2 (- x (* 0.3333333333333333 (/ y z)))))
   (if (<= y -0.00055)
     t_2
     (if (<= y -1.28e-123)
       t_1
       (if (<= y -1.9e-291)
         (* 0.3333333333333333 (/ (- (/ t y) y) z))
         (if (<= y 4.9e+39) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (0.3333333333333333 / ((y * z) / t));
	double t_2 = x - (0.3333333333333333 * (y / z));
	double tmp;
	if (y <= -0.00055) {
		tmp = t_2;
	} else if (y <= -1.28e-123) {
		tmp = t_1;
	} else if (y <= -1.9e-291) {
		tmp = 0.3333333333333333 * (((t / y) - y) / z);
	} else if (y <= 4.9e+39) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (0.3333333333333333d0 / ((y * z) / t))
    t_2 = x - (0.3333333333333333d0 * (y / z))
    if (y <= (-0.00055d0)) then
        tmp = t_2
    else if (y <= (-1.28d-123)) then
        tmp = t_1
    else if (y <= (-1.9d-291)) then
        tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
    else if (y <= 4.9d+39) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (0.3333333333333333 / ((y * z) / t));
	double t_2 = x - (0.3333333333333333 * (y / z));
	double tmp;
	if (y <= -0.00055) {
		tmp = t_2;
	} else if (y <= -1.28e-123) {
		tmp = t_1;
	} else if (y <= -1.9e-291) {
		tmp = 0.3333333333333333 * (((t / y) - y) / z);
	} else if (y <= 4.9e+39) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (0.3333333333333333 / ((y * z) / t))
	t_2 = x - (0.3333333333333333 * (y / z))
	tmp = 0
	if y <= -0.00055:
		tmp = t_2
	elif y <= -1.28e-123:
		tmp = t_1
	elif y <= -1.9e-291:
		tmp = 0.3333333333333333 * (((t / y) - y) / z)
	elif y <= 4.9e+39:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(0.3333333333333333 / Float64(Float64(y * z) / t)))
	t_2 = Float64(x - Float64(0.3333333333333333 * Float64(y / z)))
	tmp = 0.0
	if (y <= -0.00055)
		tmp = t_2;
	elseif (y <= -1.28e-123)
		tmp = t_1;
	elseif (y <= -1.9e-291)
		tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z));
	elseif (y <= 4.9e+39)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (0.3333333333333333 / ((y * z) / t));
	t_2 = x - (0.3333333333333333 * (y / z));
	tmp = 0.0;
	if (y <= -0.00055)
		tmp = t_2;
	elseif (y <= -1.28e-123)
		tmp = t_1;
	elseif (y <= -1.9e-291)
		tmp = 0.3333333333333333 * (((t / y) - y) / z);
	elseif (y <= 4.9e+39)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(0.3333333333333333 / N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.00055], t$95$2, If[LessEqual[y, -1.28e-123], t$95$1, If[LessEqual[y, -1.9e-291], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.9e+39], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{0.3333333333333333}{\frac{y \cdot z}{t}}\\
t_2 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -0.00055:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -1.28 \cdot 10^{-123}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 4.9 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.50000000000000033e-4 or 4.89999999999999987e39 < y

    1. Initial program 99.8%

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

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

    if -5.50000000000000033e-4 < y < -1.28000000000000002e-123 or -1.8999999999999999e-291 < y < 4.89999999999999987e39

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}} \]
      2. distribute-lft-out--91.9%

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

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

        \[\leadsto x + \frac{1}{\frac{\color{blue}{1 \cdot z}}{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}} \]
      5. distribute-lft-out--91.9%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{\frac{1}{3}}{\frac{z}{\frac{t}{y} - y}}} \]
      2. metadata-eval91.9%

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

      \[\leadsto x + \color{blue}{\frac{0.3333333333333333}{\frac{z}{\frac{t}{y} - y}}} \]
    10. Taylor expanded in t around inf 87.1%

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

    if -1.28000000000000002e-123 < y < -1.8999999999999999e-291

    1. Initial program 75.9%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Step-by-step derivation
      1. distribute-lft-out--85.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.00055:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq -1.28 \cdot 10^{-123}:\\ \;\;\;\;x + \frac{0.3333333333333333}{\frac{y \cdot z}{t}}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-291}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+39}:\\ \;\;\;\;x + \frac{0.3333333333333333}{\frac{y \cdot z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{if}\;y \leq -25:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -8.2 \cdot 10^{-123}:\\ \;\;\;\;x + t \cdot \frac{0.3333333333333333}{y \cdot z}\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-290}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+39}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- x (* 0.3333333333333333 (/ y z)))))
   (if (<= y -25.0)
     t_1
     (if (<= y -8.2e-123)
       (+ x (* t (/ 0.3333333333333333 (* y z))))
       (if (<= y -1e-290)
         (* 0.3333333333333333 (/ (- (/ t y) y) z))
         (if (<= y 2.7e+39)
           (+ x (* 0.3333333333333333 (/ t (* y z))))
           t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x - (0.3333333333333333 * (y / z));
	double tmp;
	if (y <= -25.0) {
		tmp = t_1;
	} else if (y <= -8.2e-123) {
		tmp = x + (t * (0.3333333333333333 / (y * z)));
	} else if (y <= -1e-290) {
		tmp = 0.3333333333333333 * (((t / y) - y) / z);
	} else if (y <= 2.7e+39) {
		tmp = x + (0.3333333333333333 * (t / (y * z)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x - (0.3333333333333333d0 * (y / z))
    if (y <= (-25.0d0)) then
        tmp = t_1
    else if (y <= (-8.2d-123)) then
        tmp = x + (t * (0.3333333333333333d0 / (y * z)))
    else if (y <= (-1d-290)) then
        tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
    else if (y <= 2.7d+39) then
        tmp = x + (0.3333333333333333d0 * (t / (y * z)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x - (0.3333333333333333 * (y / z));
	double tmp;
	if (y <= -25.0) {
		tmp = t_1;
	} else if (y <= -8.2e-123) {
		tmp = x + (t * (0.3333333333333333 / (y * z)));
	} else if (y <= -1e-290) {
		tmp = 0.3333333333333333 * (((t / y) - y) / z);
	} else if (y <= 2.7e+39) {
		tmp = x + (0.3333333333333333 * (t / (y * z)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x - (0.3333333333333333 * (y / z))
	tmp = 0
	if y <= -25.0:
		tmp = t_1
	elif y <= -8.2e-123:
		tmp = x + (t * (0.3333333333333333 / (y * z)))
	elif y <= -1e-290:
		tmp = 0.3333333333333333 * (((t / y) - y) / z)
	elif y <= 2.7e+39:
		tmp = x + (0.3333333333333333 * (t / (y * z)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x - Float64(0.3333333333333333 * Float64(y / z)))
	tmp = 0.0
	if (y <= -25.0)
		tmp = t_1;
	elseif (y <= -8.2e-123)
		tmp = Float64(x + Float64(t * Float64(0.3333333333333333 / Float64(y * z))));
	elseif (y <= -1e-290)
		tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z));
	elseif (y <= 2.7e+39)
		tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x - (0.3333333333333333 * (y / z));
	tmp = 0.0;
	if (y <= -25.0)
		tmp = t_1;
	elseif (y <= -8.2e-123)
		tmp = x + (t * (0.3333333333333333 / (y * z)));
	elseif (y <= -1e-290)
		tmp = 0.3333333333333333 * (((t / y) - y) / z);
	elseif (y <= 2.7e+39)
		tmp = x + (0.3333333333333333 * (t / (y * z)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -25.0], t$95$1, If[LessEqual[y, -8.2e-123], N[(x + N[(t * N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1e-290], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+39], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -25:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;y \leq 2.7 \cdot 10^{+39}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -25 or 2.70000000000000003e39 < y

    1. Initial program 99.8%

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

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

    if -25 < y < -8.2000000000000001e-123

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}} \]
      2. distribute-lft-out--97.3%

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

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

        \[\leadsto x + \frac{1}{\frac{\color{blue}{1 \cdot z}}{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}} \]
      5. distribute-lft-out--97.3%

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{0.3333333333333333}{\frac{z}{\frac{t}{y} - y}}} \]
    10. Taylor expanded in t around inf 82.8%

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

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

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

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

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

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

    if -8.2000000000000001e-123 < y < -1.0000000000000001e-290

    1. Initial program 75.9%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Step-by-step derivation
      1. distribute-lft-out--85.7%

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

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

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

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

    if -1.0000000000000001e-290 < y < 2.70000000000000003e39

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -25:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq -8.2 \cdot 10^{-123}:\\ \;\;\;\;x + t \cdot \frac{0.3333333333333333}{y \cdot z}\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-290}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+39}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 86.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ t_2 := x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{if}\;y \leq -2.2 \cdot 10^{-26}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-123}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{-291}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\ \mathbf{elif}\;y \leq 9.4 \cdot 10^{+33}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* 0.3333333333333333 (/ t (* y z)))))
        (t_2 (- x (* 0.3333333333333333 (/ y z)))))
   (if (<= y -2.2e-26)
     t_2
     (if (<= y -1.25e-123)
       t_1
       (if (<= y -5.4e-291)
         (* 0.3333333333333333 (/ (- (/ t y) y) z))
         (if (<= y 9.4e+33) t_1 t_2))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (0.3333333333333333 * (t / (y * z)));
	double t_2 = x - (0.3333333333333333 * (y / z));
	double tmp;
	if (y <= -2.2e-26) {
		tmp = t_2;
	} else if (y <= -1.25e-123) {
		tmp = t_1;
	} else if (y <= -5.4e-291) {
		tmp = 0.3333333333333333 * (((t / y) - y) / z);
	} else if (y <= 9.4e+33) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (0.3333333333333333d0 * (t / (y * z)))
    t_2 = x - (0.3333333333333333d0 * (y / z))
    if (y <= (-2.2d-26)) then
        tmp = t_2
    else if (y <= (-1.25d-123)) then
        tmp = t_1
    else if (y <= (-5.4d-291)) then
        tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
    else if (y <= 9.4d+33) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (0.3333333333333333 * (t / (y * z)));
	double t_2 = x - (0.3333333333333333 * (y / z));
	double tmp;
	if (y <= -2.2e-26) {
		tmp = t_2;
	} else if (y <= -1.25e-123) {
		tmp = t_1;
	} else if (y <= -5.4e-291) {
		tmp = 0.3333333333333333 * (((t / y) - y) / z);
	} else if (y <= 9.4e+33) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (0.3333333333333333 * (t / (y * z)))
	t_2 = x - (0.3333333333333333 * (y / z))
	tmp = 0
	if y <= -2.2e-26:
		tmp = t_2
	elif y <= -1.25e-123:
		tmp = t_1
	elif y <= -5.4e-291:
		tmp = 0.3333333333333333 * (((t / y) - y) / z)
	elif y <= 9.4e+33:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z))))
	t_2 = Float64(x - Float64(0.3333333333333333 * Float64(y / z)))
	tmp = 0.0
	if (y <= -2.2e-26)
		tmp = t_2;
	elseif (y <= -1.25e-123)
		tmp = t_1;
	elseif (y <= -5.4e-291)
		tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z));
	elseif (y <= 9.4e+33)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (0.3333333333333333 * (t / (y * z)));
	t_2 = x - (0.3333333333333333 * (y / z));
	tmp = 0.0;
	if (y <= -2.2e-26)
		tmp = t_2;
	elseif (y <= -1.25e-123)
		tmp = t_1;
	elseif (y <= -5.4e-291)
		tmp = 0.3333333333333333 * (((t / y) - y) / z);
	elseif (y <= 9.4e+33)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e-26], t$95$2, If[LessEqual[y, -1.25e-123], t$95$1, If[LessEqual[y, -5.4e-291], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.4e+33], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
t_2 := x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{-26}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -1.25 \cdot 10^{-123}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 9.4 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.2000000000000001e-26 or 9.3999999999999996e33 < y

    1. Initial program 99.8%

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

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

    if -2.2000000000000001e-26 < y < -1.25000000000000007e-123 or -5.39999999999999983e-291 < y < 9.3999999999999996e33

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25000000000000007e-123 < y < -5.39999999999999983e-291

    1. Initial program 75.9%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Step-by-step derivation
      1. distribute-lft-out--85.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{-26}:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-123}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{-291}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\ \mathbf{elif}\;y \leq 9.4 \cdot 10^{+33}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 97.8% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 7.0000000000000001e-15

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.0000000000000001e-15 < t

    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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 94.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq 2 \cdot 10^{+138}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z #s(literal 3 binary64)) < 2.0000000000000001e138

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e138 < (*.f64 z #s(literal 3 binary64))

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{0.3333333333333333 \cdot \left(\frac{t}{y} - y\right)}{z}} \]
      2. distribute-lft-out--80.5%

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

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

        \[\leadsto x + \frac{1}{\frac{\color{blue}{1 \cdot z}}{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}} \]
      5. distribute-lft-out--80.5%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{\frac{1}{3}}{\frac{z}{\frac{t}{y} - y}}} \]
      2. metadata-eval80.6%

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

      \[\leadsto x + \color{blue}{\frac{0.3333333333333333}{\frac{z}{\frac{t}{y} - y}}} \]
    10. Taylor expanded in t around inf 91.8%

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

Alternative 9: 76.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-63} \lor \neg \left(y \leq 6 \cdot 10^{-130}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.4000000000000001e-63 or 5.99999999999999972e-130 < y

    1. Initial program 98.7%

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

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

    if -2.4000000000000001e-63 < y < 5.99999999999999972e-130

    1. Initial program 85.6%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Step-by-step derivation
      1. div-inv72.4%

        \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y\right) \cdot \frac{1}{z}} \]
      2. distribute-lft-out--72.4%

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

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

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \frac{t}{y}\right)} \cdot \frac{1}{z} \]
    7. Step-by-step derivation
      1. un-div-inv70.5%

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

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

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

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

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

Alternative 10: 76.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{-61} \lor \neg \left(y \leq 2.75 \cdot 10^{-129}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.65e-61 or 2.75000000000000012e-129 < y

    1. Initial program 98.7%

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

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

    if -2.65e-61 < y < 2.75000000000000012e-129

    1. Initial program 85.6%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    4. Taylor expanded in t around inf 70.5%

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

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

Alternative 11: 46.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-12}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 2.6 \cdot 10^{+113}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.5e-12 or 2.5999999999999999e113 < x

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5e-12 < x < 2.5999999999999999e113

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot y}{-3 \cdot z}} \]
      3. *-un-lft-identity46.2%

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

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

      \[\leadsto \color{blue}{\frac{y}{z \cdot -3}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 47.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-11}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 10^{+114}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{z}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.4000000000000003e-11 or 1e114 < x

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4000000000000003e-11 < x < 1e114

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y}}} \]
    9. Applied egg-rr46.2%

      \[\leadsto \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 46.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{-14}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.6 \cdot 10^{+113}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.79999999999999989e-14 or 1.5999999999999999e113 < x

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.79999999999999989e-14 < x < 1.5999999999999999e113

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 96.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 63.3% 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 93.9%

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

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

Alternative 16: 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 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer target: 96.0% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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