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

Percentage Accurate: 95.7% → 97.4%
Time: 8.4s
Alternatives: 13
Speedup: 0.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 95.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+111}:\\
\;\;\;\;\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}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.0000000000000004e111

    1. Initial program 99.7%

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

    if -7.0000000000000004e111 < t

    1. Initial program 94.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+111}:\\ \;\;\;\;\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} \]

Alternative 2: 60.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ t_2 := -0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{if}\;y \leq -1.65 \cdot 10^{+87}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{+56}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-190}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{-48}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 0.3333333333333333 (/ t (* y z))))
        (t_2 (* -0.3333333333333333 (/ y z))))
   (if (<= y -1.65e+87)
     t_2
     (if (<= y -4.8e+56)
       x
       (if (<= y -1.1e+46)
         t_2
         (if (<= y 7.4e-223)
           t_1
           (if (<= y 1.95e-190) x (if (<= y 2.15e-48) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = 0.3333333333333333 * (t / (y * z));
	double t_2 = -0.3333333333333333 * (y / z);
	double tmp;
	if (y <= -1.65e+87) {
		tmp = t_2;
	} else if (y <= -4.8e+56) {
		tmp = x;
	} else if (y <= -1.1e+46) {
		tmp = t_2;
	} else if (y <= 7.4e-223) {
		tmp = t_1;
	} else if (y <= 1.95e-190) {
		tmp = x;
	} else if (y <= 2.15e-48) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 0.3333333333333333d0 * (t / (y * z))
    t_2 = (-0.3333333333333333d0) * (y / z)
    if (y <= (-1.65d+87)) then
        tmp = t_2
    else if (y <= (-4.8d+56)) then
        tmp = x
    else if (y <= (-1.1d+46)) then
        tmp = t_2
    else if (y <= 7.4d-223) then
        tmp = t_1
    else if (y <= 1.95d-190) then
        tmp = x
    else if (y <= 2.15d-48) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 0.3333333333333333 * (t / (y * z));
	double t_2 = -0.3333333333333333 * (y / z);
	double tmp;
	if (y <= -1.65e+87) {
		tmp = t_2;
	} else if (y <= -4.8e+56) {
		tmp = x;
	} else if (y <= -1.1e+46) {
		tmp = t_2;
	} else if (y <= 7.4e-223) {
		tmp = t_1;
	} else if (y <= 1.95e-190) {
		tmp = x;
	} else if (y <= 2.15e-48) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 0.3333333333333333 * (t / (y * z))
	t_2 = -0.3333333333333333 * (y / z)
	tmp = 0
	if y <= -1.65e+87:
		tmp = t_2
	elif y <= -4.8e+56:
		tmp = x
	elif y <= -1.1e+46:
		tmp = t_2
	elif y <= 7.4e-223:
		tmp = t_1
	elif y <= 1.95e-190:
		tmp = x
	elif y <= 2.15e-48:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(0.3333333333333333 * Float64(t / Float64(y * z)))
	t_2 = Float64(-0.3333333333333333 * Float64(y / z))
	tmp = 0.0
	if (y <= -1.65e+87)
		tmp = t_2;
	elseif (y <= -4.8e+56)
		tmp = x;
	elseif (y <= -1.1e+46)
		tmp = t_2;
	elseif (y <= 7.4e-223)
		tmp = t_1;
	elseif (y <= 1.95e-190)
		tmp = x;
	elseif (y <= 2.15e-48)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 0.3333333333333333 * (t / (y * z));
	t_2 = -0.3333333333333333 * (y / z);
	tmp = 0.0;
	if (y <= -1.65e+87)
		tmp = t_2;
	elseif (y <= -4.8e+56)
		tmp = x;
	elseif (y <= -1.1e+46)
		tmp = t_2;
	elseif (y <= 7.4e-223)
		tmp = t_1;
	elseif (y <= 1.95e-190)
		tmp = x;
	elseif (y <= 2.15e-48)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.65e+87], t$95$2, If[LessEqual[y, -4.8e+56], x, If[LessEqual[y, -1.1e+46], t$95$2, If[LessEqual[y, 7.4e-223], t$95$1, If[LessEqual[y, 1.95e-190], x, If[LessEqual[y, 2.15e-48], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4.8 \cdot 10^{+56}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -1.1 \cdot 10^{+46}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.95 \cdot 10^{-190}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.15 \cdot 10^{-48}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.6500000000000001e87 or -4.80000000000000027e56 < y < -1.1e46 or 2.15e-48 < y

    1. Initial program 99.2%

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

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

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

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

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

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

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

    if -1.6500000000000001e87 < y < -4.80000000000000027e56 or 7.3999999999999997e-223 < y < 1.94999999999999997e-190

    1. Initial program 100.0%

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

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

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

    if -1.1e46 < y < 7.3999999999999997e-223 or 1.94999999999999997e-190 < y < 2.15e-48

    1. Initial program 92.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+87}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{+56}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-190}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{-48}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \]

Alternative 3: 75.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.95 \cdot 10^{-190}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{-49}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.30000000000000023e-17 or 1.8999999999999999e-49 < y

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{y}{\frac{z}{\color{blue}{\frac{1}{-3}}}} \]
      4. associate-/l*91.9%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z \cdot -3}{1}}} \]
      5. /-rgt-identity91.9%

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

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

    if -4.30000000000000023e-17 < y < 7.3999999999999997e-223 or 1.94999999999999997e-190 < y < 1.8999999999999999e-49

    1. Initial program 91.3%

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

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

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

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

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

    if 7.3999999999999997e-223 < y < 1.94999999999999997e-190

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.3 \cdot 10^{-17}:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-190}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-49}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \end{array} \]

Alternative 4: 75.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{-17}:\\
\;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{-187}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-53}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.59999999999999995e-17

    1. Initial program 98.7%

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
    4. Applied egg-rr92.5%

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

    if -3.59999999999999995e-17 < y < 7.3999999999999997e-223 or 1.20000000000000007e-187 < y < 1.29999999999999998e-53

    1. Initial program 91.3%

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

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

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

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

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

    if 7.3999999999999997e-223 < y < 1.20000000000000007e-187

    1. Initial program 100.0%

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

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

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

    if 1.29999999999999998e-53 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{y}{\frac{z}{\color{blue}{\frac{1}{-3}}}} \]
      4. associate-/l*91.4%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z \cdot -3}{1}}} \]
      5. /-rgt-identity91.4%

        \[\leadsto x + \frac{y}{\color{blue}{z \cdot -3}} \]
    9. Simplified91.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{-17}:\\ \;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-187}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-53}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \end{array} \]

Alternative 5: 75.5% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.95 \cdot 10^{-190}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -3.2000000000000002e-17

    1. Initial program 98.7%

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

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

        \[\leadsto x - \color{blue}{\frac{0.3333333333333333 \cdot y}{z}} \]
    4. Applied egg-rr92.5%

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

    if -3.2000000000000002e-17 < y < 7.3999999999999997e-223

    1. Initial program 92.6%

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

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

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

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(-1 \cdot \frac{t}{y \cdot z}\right)} \]
    6. Step-by-step derivation
      1. neg-mul-168.6%

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

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

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

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

    if 7.3999999999999997e-223 < y < 1.94999999999999997e-190

    1. Initial program 100.0%

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

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

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

    if 1.94999999999999997e-190 < y < 2.9000000000000002e-52

    1. Initial program 86.0%

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

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

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

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

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

    if 2.9000000000000002e-52 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{y}{\frac{z}{\color{blue}{\frac{1}{-3}}}} \]
      4. associate-/l*91.4%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z \cdot -3}{1}}} \]
      5. /-rgt-identity91.4%

        \[\leadsto x + \frac{y}{\color{blue}{z \cdot -3}} \]
    9. Simplified91.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{-17}:\\ \;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-223}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{\frac{-t}{y}}{z}\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-190}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-52}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \end{array} \]

Alternative 6: 81.8% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 98.6%

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

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

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

        \[\leadsto x + \color{blue}{{\left(\frac{z}{-0.3333333333333333}\right)}^{-1}} \cdot \left(y - \frac{t}{y}\right) \]
    4. Applied egg-rr87.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z}{-0.3333333333333333}}} \]
      3. metadata-eval77.9%

        \[\leadsto x + \frac{y}{\frac{z}{\color{blue}{\frac{1}{-3}}}} \]
      4. associate-/l*78.0%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z \cdot -3}{1}}} \]
      5. /-rgt-identity78.0%

        \[\leadsto x + \frac{y}{\color{blue}{z \cdot -3}} \]
    9. Simplified78.0%

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

    if -5.49999999999999975e53 < z < 1.84999999999999992e105

    1. Initial program 93.7%

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

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

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

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

    if 1.84999999999999992e105 < z

    1. Initial program 99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+53}:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+105}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\ \mathbf{else}:\\ \;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \]

Alternative 7: 88.6% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

    if -4.9999999999999996e44 < y < 3.1999999999999999e-46

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

    if 3.1999999999999999e-46 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{y}{\frac{z}{\color{blue}{\frac{1}{-3}}}} \]
      4. associate-/l*91.4%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z \cdot -3}{1}}} \]
      5. /-rgt-identity91.4%

        \[\leadsto x + \frac{y}{\color{blue}{z \cdot -3}} \]
    9. Simplified91.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+44}:\\ \;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-46}:\\ \;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \end{array} \]

Alternative 8: 89.3% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

    if -1.59999999999999991e50 < y < 2.6e-47

    1. Initial program 92.5%

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

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

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

    if 2.6e-47 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{y}{\frac{z}{\color{blue}{\frac{1}{-3}}}} \]
      4. associate-/l*91.4%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z \cdot -3}{1}}} \]
      5. /-rgt-identity91.4%

        \[\leadsto x + \frac{y}{\color{blue}{z \cdot -3}} \]
    9. Simplified91.4%

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

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

Alternative 9: 91.9% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

    if -1.69999999999999994e40 < y < 3.1999999999999999e-46

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1999999999999999e-46 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{y}{\frac{z}{\color{blue}{\frac{1}{-3}}}} \]
      4. associate-/l*91.4%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z \cdot -3}{1}}} \]
      5. /-rgt-identity91.4%

        \[\leadsto x + \frac{y}{\color{blue}{z \cdot -3}} \]
    9. Simplified91.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+40}:\\ \;\;\;\;x - \frac{y \cdot 0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-46}:\\ \;\;\;\;x + \frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \end{array} \]

Alternative 10: 95.6% accurate, 1.4× speedup?

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

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

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

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

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

Alternative 11: 95.6% 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 95.8%

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

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

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

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

Alternative 12: 47.8% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+88} \lor \neg \left(y \leq 5.5 \cdot 10^{-26}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.24999999999999999e88 or 5.5000000000000005e-26 < y

    1. Initial program 99.2%

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

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

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

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

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

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

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

    if -1.24999999999999999e88 < y < 5.5000000000000005e-26

    1. Initial program 93.0%

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification50.0%

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

Alternative 13: 30.5% accurate, 15.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification27.4%

    \[\leadsto x \]

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

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

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