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

Percentage Accurate: 95.4% → 96.7%
Time: 12.3s
Alternatives: 15
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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.4% 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: 96.7% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + -0.3333333333333333 \cdot \frac{y}{z}\right) + \frac{1}{z} \cdot \color{blue}{\frac{t}{3 \cdot y}} \]
      5. times-frac95.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. associate-*l*95.4%

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

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

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

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

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

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

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

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

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

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

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

    if 1.16e140 < t

    1. Initial program 91.8%

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

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

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

Alternative 2: 91.7% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

    if -1.3599999999999999e-21 < y < 8e5

    1. Initial program 92.8%

      \[\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 y around 0 90.1%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{\frac{-0.3333333333333333 \cdot t}{z}}{-y}} \]
      2. distribute-lft-neg-in96.0%

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

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

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

    if 8e5 < y

    1. Initial program 96.7%

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

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

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

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

Alternative 3: 61.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{+26}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.25 \cdot 10^{-111}:\\
\;\;\;\;x\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.45e26 or 4.1e20 < y

    1. Initial program 96.7%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    5. Taylor expanded in y around inf 70.9%

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

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

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

    if -1.45e26 < y < -1.2500000000000001e-111

    1. Initial program 96.0%

      \[\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 x around inf 53.4%

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

    if -1.2500000000000001e-111 < y < 4.1e20

    1. Initial program 92.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    5. Taylor expanded in y around 0 60.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{+26}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-111}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+20}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\ \end{array} \]

Alternative 4: 89.1% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

    if -3.15e-22 < y < 2.7e7

    1. Initial program 92.8%

      \[\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 y around 0 90.1%

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

    if 2.7e7 < y

    1. Initial program 96.7%

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

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

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

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

Alternative 5: 88.6% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

    if -1.24000000000000005e-21 < y < 5.4e7

    1. Initial program 92.8%

      \[\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 y around 0 90.1%

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

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

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

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

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

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

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

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

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

    if 5.4e7 < y

    1. Initial program 96.7%

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

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

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

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

Alternative 6: 88.7% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

    if -3.3999999999999998e-22 < y < 7.6999999999999999e34

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

    if 7.6999999999999999e34 < y

    1. Initial program 98.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-22}:\\ \;\;\;\;x + \frac{y}{z \cdot -3}\\ \mathbf{elif}\;y \leq 7.7 \cdot 10^{+34}:\\ \;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\ \end{array} \]

Alternative 7: 77.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-117} \lor \neg \left(y \leq 4200\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.40000000000000014e-117 or 4200 < y

    1. Initial program 96.6%

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

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

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

    if -2.40000000000000014e-117 < y < 4200

    1. Initial program 92.4%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    4. Applied egg-rr93.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    5. Taylor expanded in y around 0 61.2%

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

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

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

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

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

Alternative 8: 77.3% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 150:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{z}}{y}\\

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


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

    1. Initial program 96.5%

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

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

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{z \cdot \frac{1}{-0.3333333333333333}}} \]
      5. metadata-eval88.3%

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

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

    if -8.4999999999999995e-116 < y < 150

    1. Initial program 92.4%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    4. Applied egg-rr93.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    5. Taylor expanded in y around 0 61.2%

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

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

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

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

    if 150 < y

    1. Initial program 96.7%

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

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

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

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

Alternative 9: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

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

Alternative 10: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

Alternative 11: 95.9% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

Alternative 12: 48.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+19}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{+77}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.5e19 or 6.5e77 < z

    1. Initial program 98.9%

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

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

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

    if -7.5e19 < z < 6.5e77

    1. Initial program 92.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    5. Taylor expanded in y around inf 51.1%

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

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

Alternative 13: 48.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+17}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.7 \cdot 10^{+78}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4e17 or 1.70000000000000004e78 < z

    1. Initial program 98.9%

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

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

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

    if -4.4e17 < z < 1.70000000000000004e78

    1. Initial program 92.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    5. Taylor expanded in y around inf 51.1%

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
    7. Applied egg-rr51.2%

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y}}} \]
      2. associate-/r/51.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+17}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+78}:\\ \;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 14: 48.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.38 \cdot 10^{+20}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.5 \cdot 10^{+79}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.38e20 or 1.49999999999999987e79 < z

    1. Initial program 98.9%

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

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

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

    if -1.38e20 < z < 1.49999999999999987e79

    1. Initial program 92.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    4. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-0.3333333333333333}{z}, y - \frac{t}{y}, x\right)} \]
    5. Taylor expanded in y around inf 51.1%

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

        \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot y}{z}} \]
    7. Applied egg-rr51.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.38 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+79}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 15: 31.5% accurate, 15.0× speedup?

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

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

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

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

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

    \[\leadsto x \]

Developer target: 96.0% accurate, 1.0× speedup?

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

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

Reproduce

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