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

Percentage Accurate: 95.4% → 97.6%
Time: 10.9s
Alternatives: 16
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

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


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

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e15 < t

    1. Initial program 98.1%

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

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

Alternative 2: 97.6% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e15 < t

    1. Initial program 98.1%

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

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

Alternative 3: 58.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{0.3333333333333333}{y \cdot z}\\
\mathbf{if}\;y \leq -2.16 \cdot 10^{+49}:\\
\;\;\;\;\frac{\frac{y}{-3}}{z}\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-166}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-36}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 5.1 \cdot 10^{-15}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 97.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
      2. div-inv69.2%

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

        \[\leadsto y \cdot \frac{1}{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}} \]
      4. metadata-eval69.2%

        \[\leadsto y \cdot \frac{1}{z \cdot \color{blue}{-3}} \]
    7. Applied egg-rr69.2%

      \[\leadsto \color{blue}{y \cdot \frac{1}{z \cdot -3}} \]
    8. Step-by-step derivation
      1. un-div-inv69.3%

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

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

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

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

    if -2.16000000000000003e49 < y < 2.0999999999999999e-166 or 3.5e-36 < y < 5.1e-15

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{0.3333333333333333}{y \cdot z}} \]
    8. Simplified62.8%

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

    if 2.0999999999999999e-166 < y < 3.5e-36

    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. associate-+l-99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \mathsf{fma}\left(\color{blue}{-0.3333333333333333}, \frac{y}{z}, \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      12. 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) \]
      13. associate-/r*96.9%

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

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

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

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

    if 5.1e-15 < y

    1. Initial program 97.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
      2. div-inv60.5%

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{1}{z \cdot -3}} \]
    8. Step-by-step derivation
      1. un-div-inv60.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.16 \cdot 10^{+49}:\\ \;\;\;\;\frac{\frac{y}{-3}}{z}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-166}:\\ \;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{-15}:\\ \;\;\;\;t \cdot \frac{0.3333333333333333}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{z}}{-3}\\ \end{array} \]

Alternative 4: 95.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.8% accurate, 1.1× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.4e95

    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. associate-+l-99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4e95 < z < 6.9999999999999997e64

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.9999999999999997e64 < z

    1. Initial program 96.0%

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

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

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

Alternative 6: 88.1% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4999999999999997e58 < y < 3.85e-47

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.85e-47 < y

    1. Initial program 98.2%

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

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

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

Alternative 7: 88.4% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq 3.55 \cdot 10^{-47}:\\
\;\;\;\;x + \frac{t}{y \cdot \left(z \cdot 3\right)}\\

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


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999999e58 < y < 3.5500000000000001e-47

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5500000000000001e-47 < y

    1. Initial program 98.2%

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

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

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

Alternative 8: 90.8% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4999999999999997e58 < y < 3.85e-47

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.85e-47 < y

    1. Initial program 98.2%

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

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

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

Alternative 9: 74.9% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-106} \lor \neg \left(y \leq 2.15 \cdot 10^{-166}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.30000000000000016e-106 or 2.15e-166 < y

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.30000000000000016e-106 < y < 2.15e-166

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 74.9% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2499999999999999e-104 < y < 2.15e-166

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.15e-166 < y

    1. Initial program 98.6%

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

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

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

Alternative 11: 75.1% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.02000000000000001e-104 < y < 2.2000000000000001e-166

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.2000000000000001e-166 < y

    1. Initial program 98.6%

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

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

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

Alternative 12: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{1}{\frac{z}{y - \frac{t}{y}}}} + x \]
    2. un-div-inv96.4%

      \[\leadsto \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y - \frac{t}{y}}}} + x \]
  6. Applied egg-rr96.4%

    \[\leadsto \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y - \frac{t}{y}}}} + x \]
  7. Final simplification96.4%

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

Alternative 14: 47.8% accurate, 1.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.55e101 or 2.1e62 < z

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.55e101 < z < 2.1e62

    1. Initial program 95.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
      2. div-inv47.2%

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

        \[\leadsto y \cdot \frac{1}{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}} \]
      4. metadata-eval47.2%

        \[\leadsto y \cdot \frac{1}{z \cdot \color{blue}{-3}} \]
    7. Applied egg-rr47.2%

      \[\leadsto \color{blue}{y \cdot \frac{1}{z \cdot -3}} \]
    8. Taylor expanded in z around 0 47.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+101}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+62}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 15: 47.8% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;z \leq 1.2 \cdot 10^{+61}:\\
\;\;\;\;\frac{\frac{y}{z}}{-3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.1999999999999999e96 or 1.1999999999999999e61 < z

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1999999999999999e96 < z < 1.1999999999999999e61

    1. Initial program 95.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
      2. div-inv47.2%

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

        \[\leadsto y \cdot \frac{1}{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}} \]
      4. metadata-eval47.2%

        \[\leadsto y \cdot \frac{1}{z \cdot \color{blue}{-3}} \]
    7. Applied egg-rr47.2%

      \[\leadsto \color{blue}{y \cdot \frac{1}{z \cdot -3}} \]
    8. Step-by-step derivation
      1. un-div-inv47.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+96}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+61}:\\ \;\;\;\;\frac{\frac{y}{z}}{-3}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 16: 30.8% accurate, 15.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification31.7%

    \[\leadsto x \]

Developer target: 95.5% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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