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

Percentage Accurate: 96.1% → 99.4%
Time: 12.7s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 96.1% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 99.8%

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

    if -9.99999999999999934e-89 < (*.f64 z 3) < 1e-22

    1. Initial program 88.5%

      \[\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 z around 0 99.8%

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

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

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

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

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

Alternative 2: 97.9% accurate, 0.1× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.00000000000000029e42 < t

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

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

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

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

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

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

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

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

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

Alternative 3: 97.9% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e7 < t

    1. Initial program 98.1%

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

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

Alternative 4: 80.5% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 99.8%

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

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

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

    if -9.99999999999999924e-25 < (*.f64 z 3) < 9.9999999999999999e52

    1. Initial program 91.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-neg91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{-0.3333333333333333}{z} + \frac{t}{y} \cdot \frac{\color{blue}{--0.3333333333333333}}{z} \]
      8. distribute-neg-frac88.0%

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

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

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

        \[\leadsto y \cdot \frac{-0.3333333333333333}{z} + \color{blue}{\frac{-t}{y}} \cdot \frac{-0.3333333333333333}{z} \]
      12. *-rgt-identity88.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{-0.3333333333333333}{z} \cdot \left(y - \color{blue}{\frac{1 \cdot t}{y}}\right) \]
      20. *-lft-identity88.7%

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

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

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

    if 9.9999999999999999e52 < (*.f64 z 3)

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

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

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

Alternative 5: 98.0% accurate, 1.0× speedup?

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

    1. Initial program 98.6%

      \[\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. Taylor expanded in z around 0 99.7%

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

    if -1.05e-90 < y < 1.3200000000000001e-122

    1. Initial program 87.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-neg87.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{t}{y \cdot z}\right)\right)} + x \]
      2. expm1-udef39.5%

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

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

      \[\leadsto 0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{t}{z \cdot y}\right)} - 1\right)} + x \]
    7. Step-by-step derivation
      1. expm1-def41.7%

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

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

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

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

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

Alternative 6: 98.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 97.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)} \]

    if -9.99999999999999995e-91 < y < 1e-127

    1. Initial program 87.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-neg87.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{t}{y \cdot z}\right)\right)} + x \]
      2. expm1-udef39.5%

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

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

      \[\leadsto 0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{t}{z \cdot y}\right)} - 1\right)} + x \]
    7. Step-by-step derivation
      1. expm1-def41.7%

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

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

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

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

    if 1e-127 < y

    1. Initial program 99.9%

      \[\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. Taylor expanded in z around 0 99.7%

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

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

Alternative 7: 97.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 97.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)} \]

    if -9.7999999999999996e-91 < y < 1.91999999999999992e-44

    1. Initial program 89.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-neg89.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{t}{y \cdot z}\right)} - 1\right)} + x \]
      3. *-commutative41.2%

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

      \[\leadsto 0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{t}{z \cdot y}\right)} - 1\right)} + x \]
    7. Step-by-step derivation
      1. expm1-def44.1%

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

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

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

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

    if 1.91999999999999992e-44 < y

    1. Initial program 99.9%

      \[\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. Taylor expanded in z around 0 99.7%

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

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

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

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

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

Alternative 8: 87.7% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 98.3%

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

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

    if -2.09999999999999989e-29 < y < 1.1e-39

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

    if 1.1e-39 < y

    1. Initial program 99.9%

      \[\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. Taylor expanded in z around 0 99.7%

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

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

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

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

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

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

Alternative 9: 87.6% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 98.3%

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

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

    if -2.39999999999999992e-29 < y < 1.15000000000000004e-39

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

    if 1.15000000000000004e-39 < y

    1. Initial program 99.9%

      \[\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. Taylor expanded in y around inf 88.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{-29}:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{z}{-0.3333333333333333 \cdot y}}\\ \end{array} \]

Alternative 10: 88.9% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 98.3%

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

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

    if -2.29999999999999991e-29 < y < 1.04999999999999997e-39

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999997e-39 < y

    1. Initial program 99.9%

      \[\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. Taylor expanded in y around inf 88.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{-29}:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{t}{y \cdot \frac{z}{0.3333333333333333}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{z}{-0.3333333333333333 \cdot y}}\\ \end{array} \]

Alternative 11: 88.8% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 98.3%

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

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

    if -2.39999999999999992e-29 < y < 1.04999999999999997e-39

    1. Initial program 89.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-neg89.8%

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999997e-39 < y

    1. Initial program 99.9%

      \[\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. Taylor expanded in y around inf 88.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{-29}:\\ \;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-39}:\\ \;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{\frac{z}{-0.3333333333333333 \cdot y}}\\ \end{array} \]

Alternative 12: 90.9% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 98.3%

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

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

    if -2.1999999999999999e-29 < y < 1.15000000000000004e-39

    1. Initial program 89.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-neg89.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{t}{y \cdot z}\right)} - 1\right)} + x \]
      3. *-commutative43.2%

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

      \[\leadsto 0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{t}{z \cdot y}\right)} - 1\right)} + x \]
    7. Step-by-step derivation
      1. expm1-def46.1%

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

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

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

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

    if 1.15000000000000004e-39 < y

    1. Initial program 99.9%

      \[\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. Taylor expanded in y around inf 88.4%

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

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

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

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

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

Alternative 13: 47.4% accurate, 1.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.00000000000000031e47 or 5.19999999999999959e-37 < x

    1. Initial program 93.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-neg93.4%

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

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

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

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

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

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

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

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

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

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

    if -7.00000000000000031e47 < x < 5.19999999999999959e-37

    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. distribute-frac-neg96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 47.4% accurate, 1.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.6000000000000007e47 or 5.1000000000000001e-37 < x

    1. Initial program 93.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-neg93.4%

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

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

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

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

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

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

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

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

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

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

    if -7.6000000000000007e47 < x < 5.1000000000000001e-37

    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. distribute-frac-neg96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 63.9% accurate, 2.1× speedup?

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

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

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

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

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

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

Alternative 16: 30.2% 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 94.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-neg94.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification30.9%

    \[\leadsto x \]

Developer target: 96.1% 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 2023274 
(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))))