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

Percentage Accurate: 95.7% → 95.8%
Time: 8.3s
Alternatives: 10
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 10 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: 95.8% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.9 \cdot 10^{-6} \lor \neg \left(y \leq 1.1 \cdot 10^{-58}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.9e-6 or 1.10000000000000003e-58 < y

    1. Initial program 97.7%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{0.3333333333333333}}} \]
      2. div-inv90.4%

        \[\leadsto x - \color{blue}{y \cdot \frac{1}{\frac{z}{0.3333333333333333}}} \]
      3. clear-num90.4%

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{0.3333333333333333}}} \]
      3. div-inv90.5%

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

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

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

    if -6.9e-6 < y < 1.10000000000000003e-58

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{-6} \lor \neg \left(y \leq 6.5 \cdot 10^{-59}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.4999999999999999e-6 or 6.50000000000000017e-59 < y

    1. Initial program 97.7%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{0.3333333333333333}}} \]
      2. div-inv90.4%

        \[\leadsto x - \color{blue}{y \cdot \frac{1}{\frac{z}{0.3333333333333333}}} \]
      3. clear-num90.4%

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{0.3333333333333333}}} \]
      3. div-inv90.5%

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

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

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

    if -8.4999999999999999e-6 < y < 6.50000000000000017e-59

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 91.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-6} \lor \neg \left(y \leq 6.6 \cdot 10^{-43}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.50000000000000019e-6 or 6.60000000000000031e-43 < y

    1. Initial program 97.7%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{0.3333333333333333}}} \]
      2. div-inv91.0%

        \[\leadsto x - \color{blue}{y \cdot \frac{1}{\frac{z}{0.3333333333333333}}} \]
      3. clear-num91.1%

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

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

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

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

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

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

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

    if -7.50000000000000019e-6 < y < 6.60000000000000031e-43

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 91.9% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{-6} \lor \neg \left(y \leq 5.4 \cdot 10^{-43}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.4000000000000003e-6 or 5.39999999999999982e-43 < y

    1. Initial program 97.7%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{0.3333333333333333}}} \]
      2. div-inv91.0%

        \[\leadsto x - \color{blue}{y \cdot \frac{1}{\frac{z}{0.3333333333333333}}} \]
      3. clear-num91.1%

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

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

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

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

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

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

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

    if -7.4000000000000003e-6 < y < 5.39999999999999982e-43

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{-6} \lor \neg \left(y \leq 5.4 \cdot 10^{-43}\right):\\ \;\;\;\;x - \frac{y}{z \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\frac{t}{z}}{y \cdot -3}\\ \end{array} \]

Alternative 6: 95.8% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 64.5% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(-0.3333333333333333\right)} \cdot \frac{y}{z} \]
    2. distribute-lft-neg-in69.9%

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

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

      \[\leadsto x + \left(-\color{blue}{\frac{0.3333333333333333}{\frac{z}{y}}}\right) \]
    5. distribute-neg-frac69.9%

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

      \[\leadsto x + \frac{\color{blue}{-0.3333333333333333}}{\frac{z}{y}} \]
  8. Simplified69.9%

    \[\leadsto x + \color{blue}{\frac{-0.3333333333333333}{\frac{z}{y}}} \]
  9. Final simplification69.9%

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

Alternative 8: 64.5% accurate, 2.1× speedup?

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

\\
x - y \cdot \frac{0.3333333333333333}{z}
\end{array}
Derivation
  1. Initial program 95.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 69.9%

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

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

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

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

      \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{0.3333333333333333}}} \]
    2. div-inv69.9%

      \[\leadsto x - \color{blue}{y \cdot \frac{1}{\frac{z}{0.3333333333333333}}} \]
    3. clear-num69.9%

      \[\leadsto x - y \cdot \color{blue}{\frac{0.3333333333333333}{z}} \]
  6. Applied egg-rr69.9%

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

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

Alternative 9: 64.6% 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 95.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 69.9%

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

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

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

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

      \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{0.3333333333333333}}} \]
    2. div-inv69.9%

      \[\leadsto x - \color{blue}{y \cdot \frac{1}{\frac{z}{0.3333333333333333}}} \]
    3. clear-num69.9%

      \[\leadsto x - y \cdot \color{blue}{\frac{0.3333333333333333}{z}} \]
  6. Applied egg-rr69.9%

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

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

      \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{0.3333333333333333}}} \]
    3. div-inv70.0%

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

      \[\leadsto x - \frac{y}{z \cdot \color{blue}{3}} \]
  8. Applied egg-rr70.0%

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

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

Alternative 10: 31.0% 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.9%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification34.7%

    \[\leadsto x \]

Developer target: 96.3% accurate, 1.0× speedup?

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

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

Reproduce

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