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

Percentage Accurate: 95.7% → 97.3%
Time: 9.5s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 95.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.3% accurate, 0.7× speedup?

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

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

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

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


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

    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. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000005e-46 < y < 8.5000000000000007e-93

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.5000000000000007e-93 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.2% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.39999999999999984e-40 or 4.9999999999999995e-94 < y

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.39999999999999984e-40 < y < 4.9999999999999995e-94

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-40} \lor \neg \left(y \leq 4.5 \cdot 10^{-92}\right):\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.39999999999999984e-40 or 4.5e-92 < y

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.39999999999999984e-40 < y < 4.5e-92

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-45} \lor \neg \left(y \leq 2.65 \cdot 10^{-95}\right):\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7e-45 or 2.6499999999999999e-95 < y

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7e-45 < y < 2.6499999999999999e-95

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 96.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-189} \lor \neg \left(y \leq 1.15 \cdot 10^{-96}\right):\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot \left(y - \frac{t}{y}\right)}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.60000000000000017e-189 or 1.15e-96 < 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. sub-neg97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.60000000000000017e-189 < y < 1.15e-96

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 95.8% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.1000000000000001e-56 or 2.10000000000000007e-87 < y

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.1000000000000001e-56 < y < 2.10000000000000007e-87

    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. sub-neg96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 95.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := y - \frac{t}{y}\\
\mathbf{if}\;y \leq -3.7 \cdot 10^{-56}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z} \cdot t\_1\\

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

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


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

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7000000000000002e-56 < y < 1.05e-89

    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. sub-neg96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e-89 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 89.4% accurate, 0.8× speedup?

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

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

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

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


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

    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. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - 0.3333333333333333 \cdot \frac{1}{z}\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv97.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z} + x} \]
    10. Simplified99.8%

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

    if -5.5000000000000001e44 < y < 360

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 360 < y

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - 0.3333333333333333 \cdot \frac{1}{z}\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv96.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z} + x} \]
    10. Simplified96.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+44}:\\ \;\;\;\;x + \frac{y}{z} \cdot -0.3333333333333333\\ \mathbf{elif}\;y \leq 360:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 89.4% accurate, 0.8× speedup?

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

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

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

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


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

    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. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - 0.3333333333333333 \cdot \frac{1}{z}\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv97.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z} + x} \]
    10. Simplified99.8%

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

    if -5.99999999999999974e44 < y < 210

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 210 < y

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - 0.3333333333333333 \cdot \frac{1}{z}\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv96.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z} + x} \]
    10. Simplified96.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+44}:\\ \;\;\;\;x + \frac{y}{z} \cdot -0.3333333333333333\\ \mathbf{elif}\;y \leq 210:\\ \;\;\;\;x + \frac{t \cdot 0.3333333333333333}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot -0.3333333333333333}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 95.7% accurate, 1.0× speedup?

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

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

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

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

Alternative 11: 95.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 95.6% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 64.6% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} - 0.3333333333333333 \cdot \frac{1}{z}\right)} \]
  6. Step-by-step derivation
    1. cancel-sign-sub-inv54.8%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z} + x} \]
  11. Final simplification61.1%

    \[\leadsto x + \frac{y}{z} \cdot -0.3333333333333333 \]
  12. Add Preprocessing

Developer Target 1: 95.9% 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 2024179 
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

  :alt
  (! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))

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