Numeric.AD.Rank1.Halley:findZero from ad-4.2.4

Percentage Accurate: 82.3% → 98.6%
Time: 8.7s
Alternatives: 5
Speedup: 1.5×

Specification

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

\\
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
\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 5 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: 82.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.6% accurate, 1.1× speedup?

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

\\
x - \frac{y \cdot 2}{2 \cdot z - \frac{y}{\frac{z}{t}}}
\end{array}
Derivation
  1. Initial program 82.4%

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{\left(-\left(-\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\right)\right)} \]
    7. remove-double-neg82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x - \frac{y \cdot 2}{\color{blue}{z \cdot 2 - y \cdot \frac{t}{z}}} \]
  6. Simplified99.2%

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

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

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

    \[\leadsto x - \frac{y \cdot 2}{z \cdot 2 - \color{blue}{\frac{y}{\frac{z}{t}}}} \]
  9. Final simplification99.2%

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

Alternative 2: 98.5% accurate, 1.1× speedup?

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

\\
x - \frac{y \cdot 2}{2 \cdot z - y \cdot \frac{t}{z}}
\end{array}
Derivation
  1. Initial program 82.4%

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{\left(-\left(-\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\right)\right)} \]
    7. remove-double-neg82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x - \frac{y \cdot 2}{\color{blue}{z \cdot 2 - y \cdot \frac{t}{z}}} \]
  6. Simplified99.2%

    \[\leadsto x - \frac{y \cdot 2}{\color{blue}{z \cdot 2 - y \cdot \frac{t}{z}}} \]
  7. Final simplification99.2%

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

Alternative 3: 89.3% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.99999999999999984e33 or 1.05e-4 < z

    1. Initial program 71.2%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\right)\right)} \]
      7. remove-double-neg71.2%

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

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

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

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

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

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

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

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

    if -2.99999999999999984e33 < z < 1.05e-4

    1. Initial program 91.0%

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

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \cdot -1} \]
      4. cancel-sign-sub91.0%

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

        \[\leadsto x - \color{blue}{-1 \cdot \left(-\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\right)} \]
      6. mul-1-neg91.0%

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\right)\right)} \]
      7. remove-double-neg91.0%

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

        \[\leadsto x - \color{blue}{\frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{z}}} \]
      9. *-commutative92.8%

        \[\leadsto x - \frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - \color{blue}{t \cdot y}}{z}} \]
      10. *-commutative92.8%

        \[\leadsto x - \frac{y \cdot 2}{\frac{\color{blue}{z \cdot \left(z \cdot 2\right)} - t \cdot y}{z}} \]
      11. *-commutative92.8%

        \[\leadsto x - \frac{y \cdot 2}{\frac{z \cdot \left(z \cdot 2\right) - \color{blue}{y \cdot t}}{z}} \]
      12. *-commutative92.8%

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

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

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

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

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

        \[\leadsto x - \frac{y \cdot 2}{\frac{-\color{blue}{t \cdot y}}{z}} \]
      4. distribute-rgt-neg-out84.7%

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

      \[\leadsto x - \frac{y \cdot 2}{\frac{\color{blue}{t \cdot \left(-y\right)}}{z}} \]
    7. Step-by-step derivation
      1. div-inv84.1%

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

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

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

        \[\leadsto x - \color{blue}{\frac{\frac{z}{t}}{-y}} \cdot \left(y \cdot 2\right) \]
      5. add-sqr-sqrt42.8%

        \[\leadsto x - \frac{\frac{z}{t}}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \cdot \left(y \cdot 2\right) \]
      6. sqrt-unprod59.7%

        \[\leadsto x - \frac{\frac{z}{t}}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \cdot \left(y \cdot 2\right) \]
      7. sqr-neg59.7%

        \[\leadsto x - \frac{\frac{z}{t}}{\sqrt{\color{blue}{y \cdot y}}} \cdot \left(y \cdot 2\right) \]
      8. sqrt-unprod32.2%

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

        \[\leadsto x - \frac{\frac{z}{t}}{\color{blue}{y}} \cdot \left(y \cdot 2\right) \]
      10. associate-/l/63.5%

        \[\leadsto x - \color{blue}{\frac{z}{y \cdot t}} \cdot \left(y \cdot 2\right) \]
      11. add-sqr-sqrt32.1%

        \[\leadsto x - \frac{z}{y \cdot t} \cdot \left(\color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot 2\right) \]
      12. sqrt-unprod48.4%

        \[\leadsto x - \frac{z}{y \cdot t} \cdot \left(\color{blue}{\sqrt{y \cdot y}} \cdot 2\right) \]
      13. sqr-neg48.4%

        \[\leadsto x - \frac{z}{y \cdot t} \cdot \left(\sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}} \cdot 2\right) \]
      14. sqrt-unprod40.5%

        \[\leadsto x - \frac{z}{y \cdot t} \cdot \left(\color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot 2\right) \]
      15. add-sqr-sqrt84.1%

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

        \[\leadsto x - \frac{z}{y \cdot t} \cdot \color{blue}{\left(-y \cdot 2\right)} \]
      17. distribute-rgt-neg-in84.1%

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

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

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

        \[\leadsto x - \color{blue}{\frac{z \cdot \left(y \cdot -2\right)}{y \cdot t}} \]
    10. Applied egg-rr84.2%

      \[\leadsto x - \color{blue}{\frac{z \cdot \left(y \cdot -2\right)}{y \cdot t}} \]
    11. Taylor expanded in z around 0 91.2%

      \[\leadsto x - \color{blue}{-2 \cdot \frac{z}{t}} \]
    12. Step-by-step derivation
      1. *-commutative91.2%

        \[\leadsto x - \color{blue}{\frac{z}{t} \cdot -2} \]
      2. metadata-eval91.2%

        \[\leadsto x - \frac{z}{t} \cdot \color{blue}{\frac{1}{-0.5}} \]
      3. times-frac91.2%

        \[\leadsto x - \color{blue}{\frac{z \cdot 1}{t \cdot -0.5}} \]
      4. associate-*r/91.1%

        \[\leadsto x - \color{blue}{z \cdot \frac{1}{t \cdot -0.5}} \]
      5. *-commutative91.1%

        \[\leadsto x - z \cdot \frac{1}{\color{blue}{-0.5 \cdot t}} \]
      6. associate-/r*91.1%

        \[\leadsto x - z \cdot \color{blue}{\frac{\frac{1}{-0.5}}{t}} \]
      7. metadata-eval91.1%

        \[\leadsto x - z \cdot \frac{\color{blue}{-2}}{t} \]
    13. Simplified91.1%

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

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

Alternative 4: 89.3% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+32} \lor \neg \left(z \leq 2.25 \cdot 10^{-6}\right):\\
\;\;\;\;x - \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.0199999999999999e32 or 2.25000000000000006e-6 < z

    1. Initial program 71.2%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\right)\right)} \]
      7. remove-double-neg71.2%

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

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

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

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

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

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

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

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

    if -1.0199999999999999e32 < z < 2.25000000000000006e-6

    1. Initial program 91.0%

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

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

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

        \[\leadsto x + \color{blue}{\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \cdot -1} \]
      4. cancel-sign-sub91.0%

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

        \[\leadsto x - \color{blue}{-1 \cdot \left(-\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\right)} \]
      6. mul-1-neg91.0%

        \[\leadsto x - \color{blue}{\left(-\left(-\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\right)\right)} \]
      7. remove-double-neg91.0%

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

        \[\leadsto x - \color{blue}{\frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{z}}} \]
      9. *-commutative92.8%

        \[\leadsto x - \frac{y \cdot 2}{\frac{\left(z \cdot 2\right) \cdot z - \color{blue}{t \cdot y}}{z}} \]
      10. *-commutative92.8%

        \[\leadsto x - \frac{y \cdot 2}{\frac{\color{blue}{z \cdot \left(z \cdot 2\right)} - t \cdot y}{z}} \]
      11. *-commutative92.8%

        \[\leadsto x - \frac{y \cdot 2}{\frac{z \cdot \left(z \cdot 2\right) - \color{blue}{y \cdot t}}{z}} \]
      12. *-commutative92.8%

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

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

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

        \[\leadsto x - \color{blue}{\frac{-2 \cdot z}{t}} \]
      2. *-commutative91.2%

        \[\leadsto x - \frac{\color{blue}{z \cdot -2}}{t} \]
    6. Simplified91.2%

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

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

Alternative 5: 63.3% accurate, 3.4× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{\left(-\left(-\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\right)\right)} \]
    7. remove-double-neg82.4%

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

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

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

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

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

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

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

    \[\leadsto x - \color{blue}{\frac{y}{z}} \]
  5. Final simplification55.6%

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

Developer target: 99.9% accurate, 1.3× speedup?

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

\\
x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}
\end{array}

Reproduce

?
herbie shell --seed 2023326 
(FPCore (x y z t)
  :name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
  :precision binary64

  :herbie-target
  (- x (/ 1.0 (- (/ z y) (/ (/ t 2.0) z))))

  (- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t)))))