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

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

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

Initial Program: 95.7% accurate, 1.0× speedup?

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

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

Alternative 1: 97.3% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.19999999999999998e-67 or 1.2999999999999999e-16 < y

    1. Initial program 98.5%

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{1 \cdot \left(y - \frac{t}{y}\right)}{\frac{z}{-0.3333333333333333}}} \]
      2. *-un-lft-identity99.0%

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

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

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

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

    if -7.19999999999999998e-67 < y < 1.2999999999999999e-16

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.1% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 91.6%

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{1 \cdot \left(y - \frac{t}{y}\right)}{\frac{z}{-0.3333333333333333}}} \]
      2. *-un-lft-identity97.5%

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

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

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

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

    if 9.99999999999999927e-77 < t

    1. Initial program 98.6%

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

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

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

Alternative 3: 97.4% accurate, 0.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999999e-17 < y

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 98.5%

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

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

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

    if -7.0000000000000001e-67 < y < 3.2000000000000002e-17

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 97.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y - \frac{t}{y}\\ \mathbf{if}\;y \leq -6 \cdot 10^{-68}:\\ \;\;\;\;x + \frac{t_1 \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-17}:\\ \;\;\;\;x + \frac{\frac{t \cdot 0.3333333333333333}{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 -6e-68)
     (+ x (/ (* t_1 -0.3333333333333333) z))
     (if (<= y 3.2e-17)
       (+ x (/ (/ (* t 0.3333333333333333) 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 <= -6e-68) {
		tmp = x + ((t_1 * -0.3333333333333333) / z);
	} else if (y <= 3.2e-17) {
		tmp = x + (((t * 0.3333333333333333) / 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 <= (-6d-68)) then
        tmp = x + ((t_1 * (-0.3333333333333333d0)) / z)
    else if (y <= 3.2d-17) then
        tmp = x + (((t * 0.3333333333333333d0) / 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 <= -6e-68) {
		tmp = x + ((t_1 * -0.3333333333333333) / z);
	} else if (y <= 3.2e-17) {
		tmp = x + (((t * 0.3333333333333333) / 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 <= -6e-68:
		tmp = x + ((t_1 * -0.3333333333333333) / z)
	elif y <= 3.2e-17:
		tmp = x + (((t * 0.3333333333333333) / 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 <= -6e-68)
		tmp = Float64(x + Float64(Float64(t_1 * -0.3333333333333333) / z));
	elseif (y <= 3.2e-17)
		tmp = Float64(x + Float64(Float64(Float64(t * 0.3333333333333333) / 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 <= -6e-68)
		tmp = x + ((t_1 * -0.3333333333333333) / z);
	elseif (y <= 3.2e-17)
		tmp = x + (((t * 0.3333333333333333) / 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, -6e-68], N[(x + N[(N[(t$95$1 * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-17], N[(x + N[(N[(N[(t * 0.3333333333333333), $MachinePrecision] / z), $MachinePrecision] / y), $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 -6 \cdot 10^{-68}:\\
\;\;\;\;x + \frac{t_1 \cdot -0.3333333333333333}{z}\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{\frac{t \cdot 0.3333333333333333}{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 < -6e-68

    1. Initial program 99.8%

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

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

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

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

    if -6e-68 < y < 3.2000000000000002e-17

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000002e-17 < y

    1. Initial program 96.8%

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

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

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

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

Alternative 6: 89.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+28} \lor \neg \left(y \leq 4.2 \cdot 10^{+54}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.8999999999999999e28 or 4.19999999999999972e54 < y

    1. Initial program 98.1%

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

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

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

        \[\leadsto x - \color{blue}{\left(e^{\mathsf{log1p}\left(0.3333333333333333 \cdot \frac{y}{z}\right)} - 1\right)} \]
      3. associate-*r/49.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8999999999999999e28 < y < 4.19999999999999972e54

    1. Initial program 91.1%

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

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

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

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

Alternative 7: 89.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+28} \lor \neg \left(y \leq 4.5 \cdot 10^{+53}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.8000000000000001e28 or 4.5000000000000002e53 < y

    1. Initial program 98.1%

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

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

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

        \[\leadsto x - \color{blue}{\left(e^{\mathsf{log1p}\left(0.3333333333333333 \cdot \frac{y}{z}\right)} - 1\right)} \]
      3. associate-*r/49.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8000000000000001e28 < y < 4.5000000000000002e53

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 91.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+26} \lor \neg \left(y \leq 6.5 \cdot 10^{+55}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.5e26 or 6.50000000000000027e55 < y

    1. Initial program 98.9%

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u57.0%

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

        \[\leadsto x - \color{blue}{\left(e^{\mathsf{log1p}\left(0.3333333333333333 \cdot \frac{y}{z}\right)} - 1\right)} \]
      3. associate-*r/49.7%

        \[\leadsto x - \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{0.3333333333333333 \cdot y}{z}}\right)} - 1\right) \]
    4. Applied egg-rr49.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e26 < y < 6.50000000000000027e55

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 91.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+28} \lor \neg \left(y \leq 3.8 \cdot 10^{+56}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.5e28 or 3.79999999999999996e56 < y

    1. Initial program 98.9%

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u57.0%

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

        \[\leadsto x - \color{blue}{\left(e^{\mathsf{log1p}\left(0.3333333333333333 \cdot \frac{y}{z}\right)} - 1\right)} \]
      3. associate-*r/49.7%

        \[\leadsto x - \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{0.3333333333333333 \cdot y}{z}}\right)} - 1\right) \]
    4. Applied egg-rr49.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5e28 < y < 3.79999999999999996e56

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 91.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+30} \lor \neg \left(y \leq 6.5 \cdot 10^{+55}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.39999999999999992e30 or 6.50000000000000027e55 < y

    1. Initial program 98.9%

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

      \[\leadsto \color{blue}{x - 0.3333333333333333 \cdot \frac{y}{z}} \]
    3. Step-by-step derivation
      1. expm1-log1p-u57.0%

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

        \[\leadsto x - \color{blue}{\left(e^{\mathsf{log1p}\left(0.3333333333333333 \cdot \frac{y}{z}\right)} - 1\right)} \]
      3. associate-*r/49.7%

        \[\leadsto x - \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{0.3333333333333333 \cdot y}{z}}\right)} - 1\right) \]
    4. Applied egg-rr49.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.39999999999999992e30 < y < 6.50000000000000027e55

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 46.1% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+70} \lor \neg \left(y \leq 7.2 \cdot 10^{+145}\right):\\
\;\;\;\;\frac{-y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.00000000000000007e70 or 7.19999999999999948e145 < y

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y \cdot \color{blue}{0.3333333333333333}\right) \cdot \frac{1}{-z} \]
    12. Applied egg-rr76.7%

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

        \[\leadsto \color{blue}{\frac{\left(y \cdot 0.3333333333333333\right) \cdot 1}{-z}} \]
      2. *-rgt-identity76.7%

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

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

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

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

        \[\leadsto -\color{blue}{\frac{y}{\frac{-z}{-0.3333333333333333}}} \]
      7. distribute-neg-frac76.7%

        \[\leadsto \color{blue}{\frac{-y}{\frac{-z}{-0.3333333333333333}}} \]
      8. metadata-eval76.7%

        \[\leadsto \frac{-y}{\frac{-z}{\color{blue}{\frac{1}{-3}}}} \]
      9. associate-/l*76.9%

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

        \[\leadsto \frac{-y}{\frac{\color{blue}{-z \cdot -3}}{1}} \]
      11. distribute-rgt-neg-in76.9%

        \[\leadsto \frac{-y}{\frac{\color{blue}{z \cdot \left(--3\right)}}{1}} \]
      12. metadata-eval76.9%

        \[\leadsto \frac{-y}{\frac{z \cdot \color{blue}{3}}{1}} \]
      13. /-rgt-identity76.9%

        \[\leadsto \frac{-y}{\color{blue}{z \cdot 3}} \]
    14. Simplified76.9%

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

    if -1.00000000000000007e70 < y < 7.19999999999999948e145

    1. Initial program 92.0%

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

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

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

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

Alternative 12: 46.1% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+69} \lor \neg \left(y \leq 8.6 \cdot 10^{+145}\right):\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.99999999999999967e69 or 8.59999999999999996e145 < y

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.99999999999999967e69 < y < 8.59999999999999996e145

    1. Initial program 92.0%

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

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

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

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

Alternative 13: 46.1% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;y \leq 1.05 \cdot 10^{+146}:\\
\;\;\;\;x\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

      \[\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/99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative68.8%

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

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

    if -4.2000000000000003e69 < y < 1.05e146

    1. Initial program 92.0%

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

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

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

    if 1.05e146 < y

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+69}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+146}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\ \end{array} \]

Alternative 14: 46.1% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+145}:\\
\;\;\;\;x\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

      \[\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/99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
      2. *-commutative68.8%

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

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

    if -3.25e69 < y < 7.50000000000000006e145

    1. Initial program 92.0%

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

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

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

    if 7.50000000000000006e145 < y

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot -0.3333333333333333}{z}} \]
    11. Step-by-step derivation
      1. metadata-eval87.9%

        \[\leadsto \frac{y \cdot \color{blue}{\frac{1}{-3}}}{z} \]
      2. div-inv88.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.25 \cdot 10^{+69}:\\ \;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+145}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{-3}}{z}\\ \end{array} \]

Alternative 15: 63.1% accurate, 2.1× speedup?

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

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

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

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

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

Alternative 16: 63.2% accurate, 2.1× speedup?

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

\\
x - \frac{y}{z \cdot 3}
\end{array}
Derivation
  1. Initial program 94.0%

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

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

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

      \[\leadsto x - \color{blue}{\left(e^{\mathsf{log1p}\left(0.3333333333333333 \cdot \frac{y}{z}\right)} - 1\right)} \]
    3. associate-*r/41.4%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x - \color{blue}{\frac{y}{z \cdot 3}} \]
  10. Final simplification63.7%

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

Alternative 17: 29.6% 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.0%

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

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

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

    \[\leadsto x \]

Developer target: 96.2% 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 2023271 
(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))))