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

Percentage Accurate: 95.6% → 97.5%
Time: 12.3s
Alternatives: 19
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 95.6% accurate, 1.0× speedup?

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

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

Alternative 1: 97.5% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y))) < 4.0000000000000002e289

    1. Initial program 98.3%

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

    if 4.0000000000000002e289 < (+.f64 (-.f64 x (/.f64 y (*.f64 z #s(literal 3 binary64)))) (/.f64 t (*.f64 (*.f64 z #s(literal 3 binary64)) y)))

    1. Initial program 87.2%

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

        \[\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+87.2%

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

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

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

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

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

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

        \[\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*87.2%

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

        \[\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-187.2%

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

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

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

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

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

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

      \[\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 100.0%

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

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

Alternative 2: 80.8% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z #s(literal 3 binary64)) < -2e16 or 5.0000000000000004e90 < (*.f64 z #s(literal 3 binary64))

    1. Initial program 98.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-neg98.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+98.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-neg98.8%

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

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative98.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-frac98.9%

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

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

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

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

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified98.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 t around 0 81.1%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{y \cdot 0.3333333333333333}}{z} \]
    7. Simplified81.2%

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

    if -2e16 < (*.f64 z #s(literal 3 binary64)) < 5.0000000000000004e90

    1. Initial program 94.3%

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

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

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

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

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

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

Alternative 3: 58.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{y}{-3}}{z}\\
\mathbf{if}\;y \leq -1.06 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -2.65 \cdot 10^{-135}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.06e105 or 6.90000000000000034e72 < 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 t around 0 99.6%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{y \cdot 0.3333333333333333}}{z} \]
    7. Simplified99.6%

      \[\leadsto \color{blue}{x - \frac{y \cdot 0.3333333333333333}{z}} \]
    8. Taylor expanded in x around 0 75.1%

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

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

        \[\leadsto \frac{\color{blue}{\left(-0.3333333333333333\right)} \cdot y}{z} \]
      3. distribute-lft-neg-in75.1%

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot y}{\color{blue}{\sqrt{z \cdot z}}} \]
      6. sqr-neg27.1%

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

        \[\leadsto \frac{-0.3333333333333333 \cdot y}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      8. add-sqr-sqrt1.6%

        \[\leadsto \frac{-0.3333333333333333 \cdot y}{\color{blue}{-z}} \]
      9. frac-2neg1.6%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      10. clear-num1.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{0.3333333333333333 \cdot y}}} \]
      11. frac-2neg1.6%

        \[\leadsto \color{blue}{\frac{-1}{-\frac{z}{0.3333333333333333 \cdot y}}} \]
      12. metadata-eval1.6%

        \[\leadsto \frac{\color{blue}{-1}}{-\frac{z}{0.3333333333333333 \cdot y}} \]
      13. distribute-frac-neg21.6%

        \[\leadsto \color{blue}{-\frac{-1}{\frac{z}{0.3333333333333333 \cdot y}}} \]
      14. metadata-eval1.6%

        \[\leadsto -\frac{\color{blue}{-1}}{\frac{z}{0.3333333333333333 \cdot y}} \]
      15. distribute-neg-frac1.6%

        \[\leadsto -\color{blue}{\left(-\frac{1}{\frac{z}{0.3333333333333333 \cdot y}}\right)} \]
      16. clear-num1.6%

        \[\leadsto -\left(-\color{blue}{\frac{0.3333333333333333 \cdot y}{z}}\right) \]
      17. distribute-neg-frac1.6%

        \[\leadsto -\color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      18. distribute-lft-neg-in1.6%

        \[\leadsto -\frac{\color{blue}{\left(-0.3333333333333333\right) \cdot y}}{z} \]
      19. metadata-eval1.6%

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

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

      \[\leadsto \color{blue}{--0.3333333333333333 \cdot \frac{y}{z}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt0.7%

        \[\leadsto \color{blue}{\sqrt{--0.3333333333333333 \cdot \frac{y}{z}} \cdot \sqrt{--0.3333333333333333 \cdot \frac{y}{z}}} \]
      2. sqrt-unprod36.9%

        \[\leadsto \color{blue}{\sqrt{\left(--0.3333333333333333 \cdot \frac{y}{z}\right) \cdot \left(--0.3333333333333333 \cdot \frac{y}{z}\right)}} \]
      3. sqr-neg36.9%

        \[\leadsto \sqrt{\color{blue}{\left(-0.3333333333333333 \cdot \frac{y}{z}\right) \cdot \left(-0.3333333333333333 \cdot \frac{y}{z}\right)}} \]
      4. sqrt-unprod41.5%

        \[\leadsto \color{blue}{\sqrt{-0.3333333333333333 \cdot \frac{y}{z}} \cdot \sqrt{-0.3333333333333333 \cdot \frac{y}{z}}} \]
      5. add-sqr-sqrt75.1%

        \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
      6. metadata-eval75.1%

        \[\leadsto \color{blue}{\frac{1}{-3}} \cdot \frac{y}{z} \]
      7. times-frac75.0%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{-3}}{z}} \]
    12. Applied egg-rr75.2%

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

    if -1.06e105 < y < -2.65e-135

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\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 inf 55.1%

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

    if -2.65e-135 < y < 6.90000000000000034e72

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

Alternative 4: 59.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{y}{-3}}{z}\\
\mathbf{if}\;y \leq -9 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -4.75 \cdot 10^{-135}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.9999999999999997e104 or 6.90000000000000034e72 < 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 t around 0 99.6%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{y \cdot 0.3333333333333333}}{z} \]
    7. Simplified99.6%

      \[\leadsto \color{blue}{x - \frac{y \cdot 0.3333333333333333}{z}} \]
    8. Taylor expanded in x around 0 75.1%

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

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

        \[\leadsto \frac{\color{blue}{\left(-0.3333333333333333\right)} \cdot y}{z} \]
      3. distribute-lft-neg-in75.1%

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot y}{\color{blue}{\sqrt{z \cdot z}}} \]
      6. sqr-neg27.1%

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

        \[\leadsto \frac{-0.3333333333333333 \cdot y}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      8. add-sqr-sqrt1.6%

        \[\leadsto \frac{-0.3333333333333333 \cdot y}{\color{blue}{-z}} \]
      9. frac-2neg1.6%

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      10. clear-num1.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{0.3333333333333333 \cdot y}}} \]
      11. frac-2neg1.6%

        \[\leadsto \color{blue}{\frac{-1}{-\frac{z}{0.3333333333333333 \cdot y}}} \]
      12. metadata-eval1.6%

        \[\leadsto \frac{\color{blue}{-1}}{-\frac{z}{0.3333333333333333 \cdot y}} \]
      13. distribute-frac-neg21.6%

        \[\leadsto \color{blue}{-\frac{-1}{\frac{z}{0.3333333333333333 \cdot y}}} \]
      14. metadata-eval1.6%

        \[\leadsto -\frac{\color{blue}{-1}}{\frac{z}{0.3333333333333333 \cdot y}} \]
      15. distribute-neg-frac1.6%

        \[\leadsto -\color{blue}{\left(-\frac{1}{\frac{z}{0.3333333333333333 \cdot y}}\right)} \]
      16. clear-num1.6%

        \[\leadsto -\left(-\color{blue}{\frac{0.3333333333333333 \cdot y}{z}}\right) \]
      17. distribute-neg-frac1.6%

        \[\leadsto -\color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      18. distribute-lft-neg-in1.6%

        \[\leadsto -\frac{\color{blue}{\left(-0.3333333333333333\right) \cdot y}}{z} \]
      19. metadata-eval1.6%

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

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

      \[\leadsto \color{blue}{--0.3333333333333333 \cdot \frac{y}{z}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt0.7%

        \[\leadsto \color{blue}{\sqrt{--0.3333333333333333 \cdot \frac{y}{z}} \cdot \sqrt{--0.3333333333333333 \cdot \frac{y}{z}}} \]
      2. sqrt-unprod36.9%

        \[\leadsto \color{blue}{\sqrt{\left(--0.3333333333333333 \cdot \frac{y}{z}\right) \cdot \left(--0.3333333333333333 \cdot \frac{y}{z}\right)}} \]
      3. sqr-neg36.9%

        \[\leadsto \sqrt{\color{blue}{\left(-0.3333333333333333 \cdot \frac{y}{z}\right) \cdot \left(-0.3333333333333333 \cdot \frac{y}{z}\right)}} \]
      4. sqrt-unprod41.5%

        \[\leadsto \color{blue}{\sqrt{-0.3333333333333333 \cdot \frac{y}{z}} \cdot \sqrt{-0.3333333333333333 \cdot \frac{y}{z}}} \]
      5. add-sqr-sqrt75.1%

        \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{y}{z}} \]
      6. metadata-eval75.1%

        \[\leadsto \color{blue}{\frac{1}{-3}} \cdot \frac{y}{z} \]
      7. times-frac75.0%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{-3}}{z}} \]
    12. Applied egg-rr75.2%

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

    if -8.9999999999999997e104 < y < -4.75000000000000004e-135

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\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 inf 55.1%

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

    if -4.75000000000000004e-135 < y < 6.90000000000000034e72

    1. Initial program 93.4%

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

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

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

Alternative 5: 96.9% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 94.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-neg94.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+94.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-neg94.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-neg94.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-neg94.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-neg94.3%

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

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

        \[\leadsto x + \left(\color{blue}{y \cdot \frac{-1}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. *-commutative94.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-194.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-frac97.2%

        \[\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--97.8%

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

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

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

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

      \[\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 97.9%

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

    if 9.99999999999999992e-221 < (*.f64 z #s(literal 3 binary64))

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 91.2% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7e52 or 6.90000000000000034e72 < y

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified98.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 t around 0 98.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. *-commutative98.9%

        \[\leadsto x - \frac{\color{blue}{y \cdot 0.3333333333333333}}{z} \]
    7. Simplified98.9%

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

    if -7e52 < y < 6.90000000000000034e72

    1. Initial program 94.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg94.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+94.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-neg94.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-neg94.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-neg94.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-neg94.5%

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

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

        \[\leadsto x + \left(\color{blue}{y \cdot \frac{-1}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. *-commutative94.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-194.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-frac93.1%

        \[\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--93.1%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
    3. Simplified93.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 93.1%

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

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

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

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

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

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

        \[\leadsto x + -0.3333333333333333 \cdot \frac{\color{blue}{-\frac{t}{z}}}{y} \]
      6. distribute-neg-frac291.4%

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

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

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

Alternative 7: 91.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+52} \lor \neg \left(y \leq 6.9 \cdot 10^{+72}\right):\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.8e52 or 6.90000000000000034e72 < y

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified98.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 t around 0 98.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. *-commutative98.9%

        \[\leadsto x - \frac{\color{blue}{y \cdot 0.3333333333333333}}{z} \]
    7. Simplified98.9%

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

    if -3.8e52 < y < 6.90000000000000034e72

    1. Initial program 94.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg94.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+94.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-neg94.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-neg94.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-neg94.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-neg94.5%

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

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

        \[\leadsto x + \left(\color{blue}{y \cdot \frac{-1}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. *-commutative94.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-194.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-frac93.1%

        \[\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--93.1%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
    3. Simplified93.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 93.1%

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

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

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

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

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

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

        \[\leadsto x + -0.3333333333333333 \cdot \frac{\color{blue}{-\frac{t}{z}}}{y} \]
      6. distribute-neg-frac291.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{-0.3333333333333333 \cdot \frac{\frac{t}{-z}}{y}} \]
      14. clear-num29.8%

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

        \[\leadsto x - \color{blue}{\frac{-0.3333333333333333}{\frac{y}{\frac{t}{-z}}}} \]
      16. add-sqr-sqrt11.2%

        \[\leadsto x - \frac{-0.3333333333333333}{\frac{y}{\frac{t}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}} \]
      17. sqrt-unprod51.6%

        \[\leadsto x - \frac{-0.3333333333333333}{\frac{y}{\frac{t}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}} \]
    10. Applied egg-rr91.4%

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

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

Alternative 8: 91.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+52} \lor \neg \left(y \leq 6.9 \cdot 10^{+72}\right):\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.49999999999999996e52 or 6.90000000000000034e72 < y

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified98.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 t around 0 98.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. *-commutative98.9%

        \[\leadsto x - \frac{\color{blue}{y \cdot 0.3333333333333333}}{z} \]
    7. Simplified98.9%

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

    if -6.49999999999999996e52 < y < 6.90000000000000034e72

    1. Initial program 94.5%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg94.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+94.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-neg94.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-neg94.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-neg94.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-neg94.5%

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

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

        \[\leadsto x + \left(\color{blue}{y \cdot \frac{-1}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
      10. *-commutative94.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-194.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-frac93.1%

        \[\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--93.1%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{z} \cdot \left(y - \frac{t}{y}\right) \]
    3. Simplified93.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 93.1%

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

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

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

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

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

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

        \[\leadsto x + -0.3333333333333333 \cdot \frac{\color{blue}{-\frac{t}{z}}}{y} \]
      6. distribute-neg-frac291.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{-0.3333333333333333 \cdot \frac{\frac{t}{-z}}{y}} \]
      14. clear-num29.8%

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

        \[\leadsto x - \color{blue}{\frac{-0.3333333333333333}{\frac{y}{\frac{t}{-z}}}} \]
      16. add-sqr-sqrt11.2%

        \[\leadsto x - \frac{-0.3333333333333333}{\frac{y}{\frac{t}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}}} \]
      17. sqrt-unprod51.6%

        \[\leadsto x - \frac{-0.3333333333333333}{\frac{y}{\frac{t}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}}} \]
    10. Applied egg-rr91.4%

      \[\leadsto \color{blue}{x - \frac{-0.3333333333333333}{\frac{y}{\frac{t}{z}}}} \]
    11. Step-by-step derivation
      1. sub-neg91.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{-0.3333333333333333}{-\color{blue}{y \cdot \frac{z}{t}}} \]
      5. distribute-neg-frac290.6%

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{-\left(-\frac{\color{blue}{0.3333333333333333}}{y}\right)}{\frac{z}{t}} \]
      14. distribute-frac-neg290.6%

        \[\leadsto x + \frac{-\color{blue}{\frac{0.3333333333333333}{-y}}}{\frac{z}{t}} \]
      15. distribute-frac-neg290.6%

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

        \[\leadsto x + \frac{\frac{0.3333333333333333}{\color{blue}{y}}}{\frac{z}{t}} \]
    16. Simplified90.6%

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

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

Alternative 9: 88.9% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.2e-7 or 6.90000000000000034e72 < y

    1. Initial program 98.0%

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

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

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

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

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

        \[\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.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-define98.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-eval98.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*98.1%

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

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified98.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 t around 0 97.4%

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

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

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

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

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

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

    if -4.2e-7 < y < 6.90000000000000034e72

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

        \[\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*94.7%

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

        \[\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-194.7%

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

        \[\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--92.4%

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

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

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

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

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

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

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

Alternative 10: 72.4% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.2999999999999999e-135 or 6.90000000000000034e72 < y

    1. Initial program 98.4%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg98.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+98.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-neg98.4%

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

        \[\leadsto x + \left(\frac{\color{blue}{-1 \cdot y}}{z \cdot 3} + \frac{t}{\left(z \cdot 3\right) \cdot y}\right) \]
      5. *-commutative98.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-frac98.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-define98.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-eval98.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*98.4%

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

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified98.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 t around 0 90.3%

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

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

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

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

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

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

    if -3.2999999999999999e-135 < y < 6.90000000000000034e72

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

Alternative 11: 72.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{-135} \lor \neg \left(y \leq 6.9 \cdot 10^{+72}\right):\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.3e-135 or 6.90000000000000034e72 < y

    1. Initial program 98.4%

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

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

    if -5.3e-135 < y < 6.90000000000000034e72

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

Alternative 12: 72.4% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.65e-135 or 6.90000000000000034e72 < y

    1. Initial program 98.4%

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y} \]
    2. Step-by-step derivation
      1. sub-neg98.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+98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.65e-135 < y < 6.90000000000000034e72

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

Alternative 13: 72.4% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999999e-135 < y < 6.90000000000000034e72

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

    if 6.90000000000000034e72 < y

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

        \[\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*97.6%

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

        \[\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-197.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y \cdot 1}{z \cdot -3}} \]
      4. *-rgt-identity99.7%

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

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

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

Alternative 14: 96.4% accurate, 0.9× speedup?

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

\\
\left(\frac{1}{y \cdot \frac{z \cdot 3}{t}} + x\right) + \frac{y}{z \cdot -3}
\end{array}
Derivation
  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. +-commutative96.4%

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

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

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

      \[\leadsto \left(\frac{t}{\color{blue}{z \cdot \left(3 \cdot y\right)}} + x\right) + \left(-\frac{y}{z \cdot 3}\right) \]
    5. *-commutative96.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-neg296.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-in96.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-eval96.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 48.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+67}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3999999999999999e67 or 9.50000000000000028e-10 < x

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified96.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 x around inf 52.8%

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

    if -1.3999999999999999e67 < x < 9.50000000000000028e-10

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

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

        \[\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 t around 0 56.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. *-commutative56.9%

        \[\leadsto x - \frac{\color{blue}{y \cdot 0.3333333333333333}}{z} \]
    7. Simplified56.9%

      \[\leadsto \color{blue}{x - \frac{y \cdot 0.3333333333333333}{z}} \]
    8. Taylor expanded in x around 0 47.6%

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

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

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

        \[\leadsto \frac{\color{blue}{-0.3333333333333333 \cdot y}}{z} \]
      4. add-sqr-sqrt18.4%

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

        \[\leadsto \frac{-0.3333333333333333 \cdot y}{\color{blue}{\sqrt{z \cdot z}}} \]
      6. sqr-neg18.8%

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

        \[\leadsto \frac{-0.3333333333333333 \cdot y}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      8. add-sqr-sqrt1.9%

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      10. clear-num1.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{z}{0.3333333333333333 \cdot y}}} \]
      11. frac-2neg1.9%

        \[\leadsto \color{blue}{\frac{-1}{-\frac{z}{0.3333333333333333 \cdot y}}} \]
      12. metadata-eval1.9%

        \[\leadsto \frac{\color{blue}{-1}}{-\frac{z}{0.3333333333333333 \cdot y}} \]
      13. distribute-frac-neg21.9%

        \[\leadsto \color{blue}{-\frac{-1}{\frac{z}{0.3333333333333333 \cdot y}}} \]
      14. metadata-eval1.9%

        \[\leadsto -\frac{\color{blue}{-1}}{\frac{z}{0.3333333333333333 \cdot y}} \]
      15. distribute-neg-frac1.9%

        \[\leadsto -\color{blue}{\left(-\frac{1}{\frac{z}{0.3333333333333333 \cdot y}}\right)} \]
      16. clear-num1.9%

        \[\leadsto -\left(-\color{blue}{\frac{0.3333333333333333 \cdot y}{z}}\right) \]
      17. distribute-neg-frac1.9%

        \[\leadsto -\color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      18. distribute-lft-neg-in1.9%

        \[\leadsto -\frac{\color{blue}{\left(-0.3333333333333333\right) \cdot y}}{z} \]
      19. metadata-eval1.9%

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

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

      \[\leadsto \color{blue}{--0.3333333333333333 \cdot \frac{y}{z}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt1.0%

        \[\leadsto \color{blue}{\sqrt{--0.3333333333333333 \cdot \frac{y}{z}} \cdot \sqrt{--0.3333333333333333 \cdot \frac{y}{z}}} \]
      2. sqrt-unprod23.6%

        \[\leadsto \color{blue}{\sqrt{\left(--0.3333333333333333 \cdot \frac{y}{z}\right) \cdot \left(--0.3333333333333333 \cdot \frac{y}{z}\right)}} \]
      3. sqr-neg23.6%

        \[\leadsto \sqrt{\color{blue}{\left(-0.3333333333333333 \cdot \frac{y}{z}\right) \cdot \left(-0.3333333333333333 \cdot \frac{y}{z}\right)}} \]
      4. sqrt-unprod25.6%

        \[\leadsto \color{blue}{\sqrt{-0.3333333333333333 \cdot \frac{y}{z}} \cdot \sqrt{-0.3333333333333333 \cdot \frac{y}{z}}} \]
      5. add-sqr-sqrt47.6%

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

        \[\leadsto \color{blue}{\frac{1}{-3}} \cdot \frac{y}{z} \]
      7. times-frac47.6%

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

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

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

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

Alternative 16: 48.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{+66}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.6500000000000001e66 or 9.50000000000000028e-10 < x

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified96.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 x around inf 52.8%

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

    if -1.6500000000000001e66 < x < 9.50000000000000028e-10

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

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

        \[\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 t around 0 56.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. *-commutative56.9%

        \[\leadsto x - \frac{\color{blue}{y \cdot 0.3333333333333333}}{z} \]
    7. Simplified56.9%

      \[\leadsto \color{blue}{x - \frac{y \cdot 0.3333333333333333}{z}} \]
    8. Taylor expanded in x around 0 47.6%

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

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

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

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

Alternative 17: 48.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.7 \cdot 10^{+69}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.7000000000000001e69 or 4.60000000000000014e-10 < x

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
    3. Simplified96.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 x around inf 52.8%

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

    if -6.7000000000000001e69 < x < 4.60000000000000014e-10

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

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

        \[\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 t around 0 56.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
      4. *-commutative56.9%

        \[\leadsto x - \frac{\color{blue}{y \cdot 0.3333333333333333}}{z} \]
    7. Simplified56.9%

      \[\leadsto \color{blue}{x - \frac{y \cdot 0.3333333333333333}{z}} \]
    8. Taylor expanded in x around 0 47.6%

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

Alternative 18: 95.9% accurate, 1.4× speedup?

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

\\
x + -0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}
\end{array}
Derivation
  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. remove-double-neg96.4%

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

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

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

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

      \[\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*96.3%

      \[\leadsto x + \left(\color{blue}{y \cdot \frac{-1}{z \cdot 3}} - \frac{-t}{\left(z \cdot 3\right) \cdot y}\right) \]
    10. *-commutative96.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-196.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-frac95.6%

      \[\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--96.0%

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

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

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

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

    \[\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 96.1%

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

Alternative 19: 30.4% accurate, 15.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 96.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.3%

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

      \[\leadsto x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{t}{z \cdot \color{blue}{\left(y \cdot 3\right)}}\right) \]
  3. Simplified96.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 x around inf 30.3%

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

Developer Target 1: 96.0% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024180 
(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))))