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

Percentage Accurate: 82.2% → 99.9%
Time: 8.6s
Alternatives: 5
Speedup: 1.3×

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.2% 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: 99.9% accurate, 1.3× speedup?

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

\\
x - \frac{2}{\frac{z}{\frac{y}{2}} - \frac{t}{z}}
\end{array}
Derivation
  1. Initial program 81.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. remove-double-neg81.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)} \]
    2. neg-mul-181.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)} \]
    3. *-commutative81.0%

      \[\leadsto x - \color{blue}{\left(-\frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\right) \cdot -1} \]
    4. *-commutative81.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)} \]
    5. neg-mul-181.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)} \]
    6. remove-double-neg81.0%

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

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

      \[\leadsto x - \frac{y \cdot 2}{\frac{\color{blue}{z \cdot \left(2 \cdot z\right)} - y \cdot t}{z}} \]
  3. Simplified89.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 97.7%

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

      \[\leadsto x - \frac{y \cdot 2}{\color{blue}{2 \cdot z + -1 \cdot \frac{t \cdot y}{z}}} \]
    2. mul-1-neg97.7%

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

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

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

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

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

      \[\leadsto x - \frac{y \cdot 2}{\color{blue}{z \cdot 2} - \frac{y}{\frac{z}{t}}} \]
    8. associate-/r/96.2%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x - \color{blue}{{\left(0.5 \cdot \frac{2 \cdot z - t \cdot \frac{y}{z}}{y}\right)}^{-1}} \]
  9. Step-by-step derivation
    1. unpow-196.2%

      \[\leadsto x - \color{blue}{\frac{1}{0.5 \cdot \frac{2 \cdot z - t \cdot \frac{y}{z}}{y}}} \]
    2. *-commutative96.2%

      \[\leadsto x - \frac{1}{0.5 \cdot \frac{2 \cdot z - \color{blue}{\frac{y}{z} \cdot t}}{y}} \]
    3. associate-*l/97.7%

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

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

      \[\leadsto x - \frac{1}{0.5 \cdot \frac{\color{blue}{z \cdot 2} - y \cdot \frac{t}{z}}{y}} \]
  10. Simplified98.8%

    \[\leadsto x - \color{blue}{\frac{1}{0.5 \cdot \frac{z \cdot 2 - y \cdot \frac{t}{z}}{y}}} \]
  11. Step-by-step derivation
    1. expm1-log1p-u89.0%

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

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

      \[\leadsto x - \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{1}{0.5}}{\frac{z \cdot 2 - y \cdot \frac{t}{z}}{y}}}\right)} - 1\right) \]
    4. metadata-eval77.4%

      \[\leadsto x - \left(e^{\mathsf{log1p}\left(\frac{\color{blue}{2}}{\frac{z \cdot 2 - y \cdot \frac{t}{z}}{y}}\right)} - 1\right) \]
    5. div-inv77.4%

      \[\leadsto x - \left(e^{\mathsf{log1p}\left(\color{blue}{2 \cdot \frac{1}{\frac{z \cdot 2 - y \cdot \frac{t}{z}}{y}}}\right)} - 1\right) \]
    6. clear-num77.4%

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{\frac{2}{\frac{2 \cdot z - y \cdot \frac{t}{z}}{y}}} \]
    5. div-sub98.8%

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

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

      \[\leadsto x - \frac{2}{\frac{2 \cdot z}{y} - \color{blue}{1} \cdot \frac{t}{z}} \]
    8. *-lft-identity99.9%

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

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

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

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

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

Alternative 2: 87.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+64} \lor \neg \left(z \leq -28000000 \lor \neg \left(z \leq -9 \cdot 10^{-78}\right) \land z \leq 1.35 \cdot 10^{+37}\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 -1.6e+64)
         (not
          (or (<= z -28000000.0) (and (not (<= z -9e-78)) (<= z 1.35e+37)))))
   (- x (/ y z))
   (+ x (* z (/ 2.0 t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.6e+64) || !((z <= -28000000.0) || (!(z <= -9e-78) && (z <= 1.35e+37)))) {
		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.6d+64)) .or. (.not. (z <= (-28000000.0d0)) .or. (.not. (z <= (-9d-78))) .and. (z <= 1.35d+37))) 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.6e+64) || !((z <= -28000000.0) || (!(z <= -9e-78) && (z <= 1.35e+37)))) {
		tmp = x - (y / z);
	} else {
		tmp = x + (z * (2.0 / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.6e+64) or not ((z <= -28000000.0) or (not (z <= -9e-78) and (z <= 1.35e+37))):
		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.6e+64) || !((z <= -28000000.0) || (!(z <= -9e-78) && (z <= 1.35e+37))))
		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 <= -1.6e+64) || ~(((z <= -28000000.0) || (~((z <= -9e-78)) && (z <= 1.35e+37)))))
		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.6e+64], N[Not[Or[LessEqual[z, -28000000.0], And[N[Not[LessEqual[z, -9e-78]], $MachinePrecision], LessEqual[z, 1.35e+37]]]], $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 -1.6 \cdot 10^{+64} \lor \neg \left(z \leq -28000000 \lor \neg \left(z \leq -9 \cdot 10^{-78}\right) \land z \leq 1.35 \cdot 10^{+37}\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 < -1.60000000000000009e64 or -2.8e7 < z < -9e-78 or 1.34999999999999993e37 < z

    1. Initial program 68.6%

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

        \[\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. associate-/l*85.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. mul-1-neg94.4%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{z}\right)} \]
      2. sub-neg94.4%

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

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

    if -1.60000000000000009e64 < z < -2.8e7 or -9e-78 < z < 1.34999999999999993e37

    1. Initial program 93.1%

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

        \[\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. associate-/l*93.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+64} \lor \neg \left(z \leq -28000000 \lor \neg \left(z \leq -9 \cdot 10^{-78}\right) \land z \leq 1.35 \cdot 10^{+37}\right):\\ \;\;\;\;x - \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{2}{t}\\ \end{array} \]

Alternative 3: 87.6% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+64} \lor \neg \left(z \leq -50000000 \lor \neg \left(z \leq -9 \cdot 10^{-78}\right) \land z \leq 1.8 \cdot 10^{+42}\right):\\
\;\;\;\;x - \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.4000000000000002e64 or -5e7 < z < -9e-78 or 1.8e42 < z

    1. Initial program 68.6%

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

        \[\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. associate-/l*85.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. mul-1-neg94.4%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{z}\right)} \]
      2. sub-neg94.4%

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

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

    if -3.4000000000000002e64 < z < -5e7 or -9e-78 < z < 1.8e42

    1. Initial program 93.1%

      \[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. remove-double-neg93.1%

        \[\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)} \]
      2. neg-mul-193.1%

        \[\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)} \]
      3. *-commutative93.1%

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

        \[\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)} \]
      5. neg-mul-193.1%

        \[\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)} \]
      6. remove-double-neg93.1%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+64} \lor \neg \left(z \leq -50000000 \lor \neg \left(z \leq -9 \cdot 10^{-78}\right) \land z \leq 1.8 \cdot 10^{+42}\right):\\ \;\;\;\;x - \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z}{t} \cdot -2\\ \end{array} \]

Alternative 4: 82.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-78} \lor \neg \left(z \leq 5.4 \cdot 10^{+45}\right):\\
\;\;\;\;x - \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9e-78 or 5.39999999999999968e45 < z

    1. Initial program 70.5%

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

        \[\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. associate-/l*85.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{y}{z}} \]
    5. Step-by-step derivation
      1. mul-1-neg90.3%

        \[\leadsto x + \color{blue}{\left(-\frac{y}{z}\right)} \]
      2. sub-neg90.3%

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

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

    if -9e-78 < z < 5.39999999999999968e45

    1. Initial program 93.9%

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

        \[\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. associate-/l*93.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{-78} \lor \neg \left(z \leq 5.4 \cdot 10^{+45}\right):\\ \;\;\;\;x - \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 5: 75.5% accurate, 17.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 81.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-neg81.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. associate-/l*89.4%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification75.1%

    \[\leadsto x \]

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 2023334 
(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)))))