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

Percentage Accurate: 95.6% → 99.2%
Time: 13.4s
Alternatives: 24
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 24 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.6% 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: 99.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \cdot 3 \leq 10^{-62}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\

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


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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e108 < (*.f64 z 3) < 1e-62

    1. Initial program 91.2%

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

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

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

    if 1e-62 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

Alternative 2: 98.0% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999991e-137 < t

    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.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv99.6%

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{\color{blue}{\frac{z}{0.3333333333333333}}}\right) \]
      11. clear-num99.6%

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

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

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

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

Alternative 3: 99.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-5} \lor \neg \left(z \cdot 3 \leq 10^{-62}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 3) < -1.00000000000000008e-5 or 1e-62 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

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

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

    if -1.00000000000000008e-5 < (*.f64 z 3) < 1e-62

    1. Initial program 89.4%

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

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

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

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

Alternative 4: 99.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-5} \lor \neg \left(z \cdot 3 \leq 10^{-62}\right):\\
\;\;\;\;\frac{t}{y \cdot \left(z \cdot 3\right)} + \left(x - \frac{y}{z \cdot 3}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 3) < -1.00000000000000008e-5 or 1e-62 < (*.f64 z 3)

    1. Initial program 99.8%

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

    if -1.00000000000000008e-5 < (*.f64 z 3) < 1e-62

    1. Initial program 89.4%

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

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

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

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

Alternative 5: 99.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \cdot 3 \leq 10^{-62}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\

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


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

    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 \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e113 < (*.f64 z 3) < 1e-62

    1. Initial program 91.2%

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

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

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

    if 1e-62 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

Alternative 6: 91.7% accurate, 0.9× speedup?

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.99999999999999982e78 or 6.49999999999999931e60 < y

    1. Initial program 97.6%

      \[\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.6%

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

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

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

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

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

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

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

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

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

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

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

    if -2.99999999999999982e78 < y < -7.6000000000000003e30

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if -7.6000000000000003e30 < y < -3.4e8

    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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    7. Step-by-step derivation
      1. cancel-sign-sub-inv99.7%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-0.3333333333333333 \cdot t}}{-1 \cdot y} + \left(-0.3333333333333333\right) \cdot y}{z} \]
      6. distribute-rgt-neg-in99.4%

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

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

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \left(-\frac{t}{y}\right) + \color{blue}{-0.3333333333333333} \cdot y}{z} \]
      11. distribute-lft-in99.7%

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

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

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

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

        \[\leadsto \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y - \frac{t}{y}}{z} \]
      16. distribute-lft-neg-in99.7%

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

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

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

        \[\leadsto -\color{blue}{\left(y - \frac{t}{y}\right) \cdot \frac{0.3333333333333333}{z}} \]
      20. distribute-rgt-neg-in99.4%

        \[\leadsto \color{blue}{\left(y - \frac{t}{y}\right) \cdot \left(-\frac{0.3333333333333333}{z}\right)} \]
      21. distribute-neg-frac99.4%

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

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

    if -3.4e8 < y < 6.49999999999999931e60

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+78}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \mathbf{elif}\;y \leq -7.6 \cdot 10^{+30}:\\ \;\;\;\;x + \frac{t}{y \cdot \left(z \cdot 3\right)}\\ \mathbf{elif}\;y \leq -340000000:\\ \;\;\;\;\left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+60}:\\ \;\;\;\;x + \frac{\frac{t}{z} \cdot 0.3333333333333333}{y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \end{array} \]

Alternative 7: 91.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := x - \frac{y}{z \cdot 3}\\
\mathbf{if}\;y \leq -4.3 \cdot 10^{+80}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq -1.7 \cdot 10^{+15}:\\
\;\;\;\;\left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.30000000000000004e80 or 2.15e52 < y

    1. Initial program 97.6%

      \[\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.6%

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

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

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

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

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

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

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

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

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

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

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

    if -4.30000000000000004e80 < y < -1.8499999999999999e31

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if -1.8499999999999999e31 < y < -1.7e15

    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.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    7. Step-by-step derivation
      1. cancel-sign-sub-inv99.7%

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-0.3333333333333333 \cdot t}}{-1 \cdot y} + \left(-0.3333333333333333\right) \cdot y}{z} \]
      6. distribute-rgt-neg-in99.4%

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

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

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \left(-\frac{t}{y}\right) + \color{blue}{-0.3333333333333333} \cdot y}{z} \]
      11. distribute-lft-in99.7%

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

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

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

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

        \[\leadsto \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y - \frac{t}{y}}{z} \]
      16. distribute-lft-neg-in99.7%

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

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

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

        \[\leadsto -\color{blue}{\left(y - \frac{t}{y}\right) \cdot \frac{0.3333333333333333}{z}} \]
      20. distribute-rgt-neg-in99.4%

        \[\leadsto \color{blue}{\left(y - \frac{t}{y}\right) \cdot \left(-\frac{0.3333333333333333}{z}\right)} \]
      21. distribute-neg-frac99.4%

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

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

    if -1.7e15 < y < 2.15e52

    1. Initial program 93.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.3 \cdot 10^{+80}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \mathbf{elif}\;y \leq -1.85 \cdot 10^{+31}:\\ \;\;\;\;x + \frac{t}{y \cdot \left(z \cdot 3\right)}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{+15}:\\ \;\;\;\;\left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{+52}:\\ \;\;\;\;x + \frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \end{array} \]

Alternative 8: 75.4% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;y \leq 7.5 \cdot 10^{-100}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -8.49999999999999945e-33 or 1.62000000000000004e-111 < y < 7.50000000000000015e-100

    1. Initial program 98.6%

      \[\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.5%

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

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

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

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

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

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

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

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

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

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

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

    if -8.49999999999999945e-33 < y < 1.62000000000000004e-111

    1. Initial program 92.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*92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.50000000000000015e-100 < y < 115000

    1. Initial program 95.6%

      \[\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.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv95.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{0.3333333333333333}{y \cdot z}} \]
      4. clear-num59.9%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{y}{\frac{0.3333333333333333}{z}}}} \]
    9. Taylor expanded in y around 0 60.2%

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

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

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

    if 115000 < y

    1. Initial program 96.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{-33}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \mathbf{elif}\;y \leq 1.62 \cdot 10^{-111}:\\ \;\;\;\;\frac{\frac{0.3333333333333333}{z}}{\frac{y}{t}}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-100}:\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \mathbf{elif}\;y \leq 115000:\\ \;\;\;\;\frac{t}{3 \cdot \left(z \cdot y\right)}\\ \mathbf{else}:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \]

Alternative 9: 97.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.9 \cdot 10^{-41} \lor \neg \left(y \leq 3.45 \cdot 10^{-161}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.8999999999999998e-41 or 3.45000000000000001e-161 < y

    1. Initial program 97.0%

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

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

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

    if -6.8999999999999998e-41 < y < 3.45000000000000001e-161

    1. Initial program 92.1%

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

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

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

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

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

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

Alternative 10: 98.1% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

    if -6.99999999999999964e-54 < y < 3.1500000000000001e-161

    1. Initial program 91.7%

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

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

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

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

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

    if 3.1500000000000001e-161 < y

    1. Initial program 94.6%

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

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

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

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

Alternative 11: 78.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+127} \lor \neg \left(x \leq 1.42 \cdot 10^{+48}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.3000000000000002e127 or 1.42e48 < x

    1. Initial program 98.4%

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

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

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

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

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

    if -2.3000000000000002e127 < x < 1.42e48

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv94.7%

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \color{blue}{\frac{0.3333333333333333}{z}}\right) \]
    5. Applied egg-rr94.7%

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \frac{t}{y} - 0.3333333333333333 \cdot y}{z}} \]
    7. Step-by-step derivation
      1. cancel-sign-sub-inv85.2%

        \[\leadsto \frac{\color{blue}{0.3333333333333333 \cdot \frac{t}{y} + \left(-0.3333333333333333\right) \cdot y}}{z} \]
      2. metadata-eval85.2%

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{-0.3333333333333333 \cdot t}}{-1 \cdot y} + \left(-0.3333333333333333\right) \cdot y}{z} \]
      6. distribute-rgt-neg-in85.2%

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

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(-\frac{t}{y}\right)} + \left(-0.3333333333333333\right) \cdot y}{z} \]
      10. metadata-eval85.2%

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(y + \left(-\frac{t}{y}\right)\right)}}{z} \]
      13. sub-neg85.2%

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

        \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}} \]
      15. metadata-eval85.2%

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

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

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

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

        \[\leadsto -\color{blue}{\left(y - \frac{t}{y}\right) \cdot \frac{0.3333333333333333}{z}} \]
      20. distribute-rgt-neg-in85.2%

        \[\leadsto \color{blue}{\left(y - \frac{t}{y}\right) \cdot \left(-\frac{0.3333333333333333}{z}\right)} \]
      21. distribute-neg-frac85.2%

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

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

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

Alternative 12: 88.9% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.20000000000000014e78 or 5.2000000000000004e50 < y

    1. Initial program 97.6%

      \[\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.6%

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000014e78 < y < 5.2000000000000004e50

    1. Initial program 94.1%

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

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

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

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

Alternative 13: 88.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+78} \lor \neg \left(y \leq 1.6 \cdot 10^{+59}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.20000000000000014e78 or 1.59999999999999991e59 < y

    1. Initial program 97.6%

      \[\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.6%

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000014e78 < y < 1.59999999999999991e59

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

Alternative 14: 89.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+80} \lor \neg \left(y \leq 4.9 \cdot 10^{+51}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4e80 or 4.89999999999999983e51 < y

    1. Initial program 97.6%

      \[\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.6%

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

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

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

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

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

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

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

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

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

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

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

    if -4e80 < y < 4.89999999999999983e51

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 47.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+36}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \cdot 3 \leq 2 \cdot 10^{-9}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z 3) < -1.00000000000000004e36 or 2.00000000000000012e-9 < (*.f64 z 3)

    1. Initial program 99.8%

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

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

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

    if -1.00000000000000004e36 < (*.f64 z 3) < 2.00000000000000012e-9

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 60.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 2.5 \cdot 10^{+19}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\

\mathbf{elif}\;y \leq 8 \cdot 10^{+107}:\\
\;\;\;\;x\\

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


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

    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 \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv99.7%

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

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

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

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

    if -3.10000000000000021e74 < y < 2.5e19

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5e19 < y < 7.9999999999999998e107

    1. Initial program 99.8%

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

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

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

    if 7.9999999999999998e107 < y

    1. Initial program 93.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*93.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv99.7%

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

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

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

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
    7. Step-by-step derivation
      1. metadata-eval84.0%

        \[\leadsto \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y}{z} \]
      2. distribute-lft-neg-in84.0%

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

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

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

        \[\leadsto -\color{blue}{y \cdot \frac{0.3333333333333333}{z}} \]
      6. distribute-rgt-neg-in84.0%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    10. Applied egg-rr84.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+74}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+19}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+107}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \end{array} \]

Alternative 17: 75.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-33} \lor \neg \left(y \leq 15500\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.1e-33 or 15500 < y

    1. Initial program 98.2%

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

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

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

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

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

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

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

    if -4.1e-33 < y < 15500

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv91.5%

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

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

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

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

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

Alternative 18: 75.4% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 47000:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if -5.19999999999999988e-33 < y < 47000

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv91.5%

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

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

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

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

    if 47000 < y

    1. Initial program 96.1%

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

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

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

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

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

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

Alternative 19: 75.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 28000:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{z \cdot y}\\

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


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

    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 \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.8%

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

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

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

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

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

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

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

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

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

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

    if -3.3000000000000003e-33 < y < 28000

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv91.5%

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

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

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

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

    if 28000 < y

    1. Initial program 96.1%

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

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

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

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

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

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

Alternative 20: 75.5% accurate, 1.3× speedup?

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

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

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

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


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

    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 \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.8%

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

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

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

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

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

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

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

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

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

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

    if -5.4000000000000002e-33 < y < 2e4

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv91.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{y}{\frac{0.3333333333333333}{z}}}} \]
    9. Taylor expanded in y around 0 65.1%

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

        \[\leadsto \frac{t}{3 \cdot \color{blue}{\left(z \cdot y\right)}} \]
    11. Simplified65.1%

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

    if 2e4 < y

    1. Initial program 96.1%

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

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

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

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

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

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

Alternative 21: 75.4% accurate, 1.3× speedup?

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

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

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

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


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

    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 \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.8%

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000006e-32 < y < 108000

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv91.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 108000 < y

    1. Initial program 96.1%

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

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

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

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

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

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

Alternative 22: 75.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 25500:\\
\;\;\;\;\frac{t}{\frac{y}{\frac{0.3333333333333333}{z}}}\\

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


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

    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 \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.8%

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

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

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

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

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

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

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

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

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

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

    if -1.02000000000000002e-32 < y < 25500

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv91.5%

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

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

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

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

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

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

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

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

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

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

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

    if 25500 < y

    1. Initial program 96.1%

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

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

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

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

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

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

Alternative 23: 77.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 15500:\\
\;\;\;\;\frac{\frac{t \cdot 0.3333333333333333}{z}}{y}\\

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


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

    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 \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} \]
      2. *-commutative99.8%

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

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

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

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

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

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

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

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

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

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

    if -2.90000000000000003e-33 < y < 15500

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, \frac{1}{z \cdot \left(y \cdot 3\right)}, x - y \cdot \frac{1}{z \cdot \color{blue}{\frac{1}{0.3333333333333333}}}\right) \]
      10. div-inv91.5%

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

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

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

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

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

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

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

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

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

    if 15500 < y

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification26.1%

    \[\leadsto x \]

Developer target: 96.5% accurate, 1.0× speedup?

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

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

Reproduce

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