Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A

Percentage Accurate: 88.7% → 99.4%
Time: 6.3s
Alternatives: 11
Speedup: 0.3×

Specification

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

\\
\frac{x + y}{1 - \frac{y}{z}}
\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 11 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: 88.7% accurate, 1.0× speedup?

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

\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}

Alternative 1: 99.4% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{x + y}{t\_0}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-257}:\\
\;\;\;\;\frac{1}{t\_0} \cdot \left(x + y\right)\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(-z\right) - \frac{z \cdot \left(x + z\right)}{y}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -3.9999999999999999e-257

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{1 - \frac{y}{z}}{x + y}}} \]
      2. associate-/r/99.9%

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

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

    if -3.9999999999999999e-257 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < 0.0

    1. Initial program 6.1%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 99.8%

      \[\leadsto \color{blue}{\left(-1 \cdot z + -1 \cdot \frac{x \cdot z}{y}\right) - \frac{{z}^{2}}{y}} \]
    4. Step-by-step derivation
      1. associate--l+99.8%

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

        \[\leadsto -1 \cdot z + \left(\color{blue}{\frac{-1 \cdot \left(x \cdot z\right)}{y}} - \frac{{z}^{2}}{y}\right) \]
      3. div-sub99.8%

        \[\leadsto -1 \cdot z + \color{blue}{\frac{-1 \cdot \left(x \cdot z\right) - {z}^{2}}{y}} \]
      4. remove-double-neg99.8%

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

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

        \[\leadsto -1 \cdot z + \frac{-1 \cdot \left(x \cdot z\right) - \color{blue}{-1 \cdot \left(-1 \cdot {z}^{2}\right)}}{y} \]
      7. distribute-lft-out--99.8%

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

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

        \[\leadsto -1 \cdot z + \color{blue}{\left(-\frac{x \cdot z - -1 \cdot {z}^{2}}{y}\right)} \]
      10. unsub-neg99.8%

        \[\leadsto \color{blue}{-1 \cdot z - \frac{x \cdot z - -1 \cdot {z}^{2}}{y}} \]
      11. mul-1-neg99.8%

        \[\leadsto \color{blue}{\left(-z\right)} - \frac{x \cdot z - -1 \cdot {z}^{2}}{y} \]
      12. cancel-sign-sub-inv99.8%

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

        \[\leadsto \left(-z\right) - \frac{x \cdot z + \color{blue}{1} \cdot {z}^{2}}{y} \]
      14. *-lft-identity99.8%

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

        \[\leadsto \left(-z\right) - \frac{\color{blue}{{z}^{2} + x \cdot z}}{y} \]
      16. unpow299.8%

        \[\leadsto \left(-z\right) - \frac{\color{blue}{z \cdot z} + x \cdot z}{y} \]
      17. distribute-rgt-out99.8%

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

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

    if 0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z)))

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
  3. Recombined 3 regimes into one program.
  4. Final simplification99.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + y}{1 - \frac{y}{z}} \leq -4 \cdot 10^{-257}:\\ \;\;\;\;\frac{1}{1 - \frac{y}{z}} \cdot \left(x + y\right)\\ \mathbf{elif}\;\frac{x + y}{1 - \frac{y}{z}} \leq 0:\\ \;\;\;\;\left(-z\right) - \frac{z \cdot \left(x + z\right)}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.4% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-257} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -3.9999999999999999e-257 or 0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z)))

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing

    if -3.9999999999999999e-257 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < 0.0

    1. Initial program 6.1%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 99.8%

      \[\leadsto \color{blue}{\left(-1 \cdot z + -1 \cdot \frac{x \cdot z}{y}\right) - \frac{{z}^{2}}{y}} \]
    4. Step-by-step derivation
      1. associate--l+99.8%

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

        \[\leadsto -1 \cdot z + \left(\color{blue}{\frac{-1 \cdot \left(x \cdot z\right)}{y}} - \frac{{z}^{2}}{y}\right) \]
      3. div-sub99.8%

        \[\leadsto -1 \cdot z + \color{blue}{\frac{-1 \cdot \left(x \cdot z\right) - {z}^{2}}{y}} \]
      4. remove-double-neg99.8%

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

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

        \[\leadsto -1 \cdot z + \frac{-1 \cdot \left(x \cdot z\right) - \color{blue}{-1 \cdot \left(-1 \cdot {z}^{2}\right)}}{y} \]
      7. distribute-lft-out--99.8%

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

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

        \[\leadsto -1 \cdot z + \color{blue}{\left(-\frac{x \cdot z - -1 \cdot {z}^{2}}{y}\right)} \]
      10. unsub-neg99.8%

        \[\leadsto \color{blue}{-1 \cdot z - \frac{x \cdot z - -1 \cdot {z}^{2}}{y}} \]
      11. mul-1-neg99.8%

        \[\leadsto \color{blue}{\left(-z\right)} - \frac{x \cdot z - -1 \cdot {z}^{2}}{y} \]
      12. cancel-sign-sub-inv99.8%

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

        \[\leadsto \left(-z\right) - \frac{x \cdot z + \color{blue}{1} \cdot {z}^{2}}{y} \]
      14. *-lft-identity99.8%

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

        \[\leadsto \left(-z\right) - \frac{\color{blue}{{z}^{2} + x \cdot z}}{y} \]
      16. unpow299.8%

        \[\leadsto \left(-z\right) - \frac{\color{blue}{z \cdot z} + x \cdot z}{y} \]
      17. distribute-rgt-out99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + y}{1 - \frac{y}{z}} \leq -4 \cdot 10^{-257} \lor \neg \left(\frac{x + y}{1 - \frac{y}{z}} \leq 0\right):\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) - \frac{z \cdot \left(x + z\right)}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 99.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-257} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -3.9999999999999999e-257 or 0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z)))

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing

    if -3.9999999999999999e-257 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < 0.0

    1. Initial program 6.1%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 99.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot \left(x + y\right)}{y}} \]
    4. Step-by-step derivation
      1. mul-1-neg99.8%

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in99.8%

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

        \[\leadsto z \cdot \color{blue}{\frac{x + y}{-y}} \]
      5. +-commutative99.8%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{-y} \]
    5. Simplified99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x + y}{1 - \frac{y}{z}} \leq -4 \cdot 10^{-257} \lor \neg \left(\frac{x + y}{1 - \frac{y}{z}} \leq 0\right):\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{-\left(x + y\right)}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+238}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+84} \lor \neg \left(y \leq -130000000 \lor \neg \left(y \leq -6.7 \cdot 10^{-62}\right) \land y \leq 3.9 \cdot 10^{-30}\right):\\ \;\;\;\;\frac{z \cdot \left(x + y\right)}{-y}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -2.1e+238)
   (- z)
   (if (or (<= y -2.2e+84)
           (not
            (or (<= y -130000000.0)
                (and (not (<= y -6.7e-62)) (<= y 3.9e-30)))))
     (/ (* z (+ x y)) (- y))
     (+ x y))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -2.1e+238) {
		tmp = -z;
	} else if ((y <= -2.2e+84) || !((y <= -130000000.0) || (!(y <= -6.7e-62) && (y <= 3.9e-30)))) {
		tmp = (z * (x + y)) / -y;
	} else {
		tmp = x + y;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-2.1d+238)) then
        tmp = -z
    else if ((y <= (-2.2d+84)) .or. (.not. (y <= (-130000000.0d0)) .or. (.not. (y <= (-6.7d-62))) .and. (y <= 3.9d-30))) then
        tmp = (z * (x + y)) / -y
    else
        tmp = x + y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -2.1e+238) {
		tmp = -z;
	} else if ((y <= -2.2e+84) || !((y <= -130000000.0) || (!(y <= -6.7e-62) && (y <= 3.9e-30)))) {
		tmp = (z * (x + y)) / -y;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -2.1e+238:
		tmp = -z
	elif (y <= -2.2e+84) or not ((y <= -130000000.0) or (not (y <= -6.7e-62) and (y <= 3.9e-30))):
		tmp = (z * (x + y)) / -y
	else:
		tmp = x + y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -2.1e+238)
		tmp = Float64(-z);
	elseif ((y <= -2.2e+84) || !((y <= -130000000.0) || (!(y <= -6.7e-62) && (y <= 3.9e-30))))
		tmp = Float64(Float64(z * Float64(x + y)) / Float64(-y));
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -2.1e+238)
		tmp = -z;
	elseif ((y <= -2.2e+84) || ~(((y <= -130000000.0) || (~((y <= -6.7e-62)) && (y <= 3.9e-30)))))
		tmp = (z * (x + y)) / -y;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -2.1e+238], (-z), If[Or[LessEqual[y, -2.2e+84], N[Not[Or[LessEqual[y, -130000000.0], And[N[Not[LessEqual[y, -6.7e-62]], $MachinePrecision], LessEqual[y, 3.9e-30]]]], $MachinePrecision]], N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / (-y)), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+238}:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq -2.2 \cdot 10^{+84} \lor \neg \left(y \leq -130000000 \lor \neg \left(y \leq -6.7 \cdot 10^{-62}\right) \land y \leq 3.9 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{z \cdot \left(x + y\right)}{-y}\\

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


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

    1. Initial program 73.0%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 92.9%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-neg92.9%

        \[\leadsto \color{blue}{-z} \]
    5. Simplified92.9%

      \[\leadsto \color{blue}{-z} \]

    if -2.10000000000000007e238 < y < -2.1999999999999998e84 or -1.3e8 < y < -6.69999999999999992e-62 or 3.9000000000000003e-30 < y

    1. Initial program 71.1%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 75.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot \left(x + y\right)}{y}} \]
    4. Step-by-step derivation
      1. mul-1-neg75.6%

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

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

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

    if -2.1999999999999998e84 < y < -1.3e8 or -6.69999999999999992e-62 < y < 3.9000000000000003e-30

    1. Initial program 99.2%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 82.5%

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative82.5%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified82.5%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+238}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+84} \lor \neg \left(y \leq -130000000 \lor \neg \left(y \leq -6.7 \cdot 10^{-62}\right) \land y \leq 3.9 \cdot 10^{-30}\right):\\ \;\;\;\;\frac{z \cdot \left(x + y\right)}{-y}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \frac{-\left(x + y\right)}{y}\\ \mathbf{if}\;y \leq -2.2 \cdot 10^{+84}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -22000000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -6.4 \cdot 10^{-62}:\\ \;\;\;\;\frac{z \cdot \left(x + y\right)}{-y}\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{-30}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (/ (- (+ x y)) y))))
   (if (<= y -2.2e+84)
     t_0
     (if (<= y -22000000.0)
       (+ x y)
       (if (<= y -6.4e-62)
         (/ (* z (+ x y)) (- y))
         (if (<= y 2.95e-30) (* (+ x y) (+ 1.0 (/ y z))) t_0))))))
double code(double x, double y, double z) {
	double t_0 = z * (-(x + y) / y);
	double tmp;
	if (y <= -2.2e+84) {
		tmp = t_0;
	} else if (y <= -22000000.0) {
		tmp = x + y;
	} else if (y <= -6.4e-62) {
		tmp = (z * (x + y)) / -y;
	} else if (y <= 2.95e-30) {
		tmp = (x + y) * (1.0 + (y / z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = z * (-(x + y) / y)
    if (y <= (-2.2d+84)) then
        tmp = t_0
    else if (y <= (-22000000.0d0)) then
        tmp = x + y
    else if (y <= (-6.4d-62)) then
        tmp = (z * (x + y)) / -y
    else if (y <= 2.95d-30) then
        tmp = (x + y) * (1.0d0 + (y / z))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * (-(x + y) / y);
	double tmp;
	if (y <= -2.2e+84) {
		tmp = t_0;
	} else if (y <= -22000000.0) {
		tmp = x + y;
	} else if (y <= -6.4e-62) {
		tmp = (z * (x + y)) / -y;
	} else if (y <= 2.95e-30) {
		tmp = (x + y) * (1.0 + (y / z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (-(x + y) / y)
	tmp = 0
	if y <= -2.2e+84:
		tmp = t_0
	elif y <= -22000000.0:
		tmp = x + y
	elif y <= -6.4e-62:
		tmp = (z * (x + y)) / -y
	elif y <= 2.95e-30:
		tmp = (x + y) * (1.0 + (y / z))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(Float64(-Float64(x + y)) / y))
	tmp = 0.0
	if (y <= -2.2e+84)
		tmp = t_0;
	elseif (y <= -22000000.0)
		tmp = Float64(x + y);
	elseif (y <= -6.4e-62)
		tmp = Float64(Float64(z * Float64(x + y)) / Float64(-y));
	elseif (y <= 2.95e-30)
		tmp = Float64(Float64(x + y) * Float64(1.0 + Float64(y / z)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * (-(x + y) / y);
	tmp = 0.0;
	if (y <= -2.2e+84)
		tmp = t_0;
	elseif (y <= -22000000.0)
		tmp = x + y;
	elseif (y <= -6.4e-62)
		tmp = (z * (x + y)) / -y;
	elseif (y <= 2.95e-30)
		tmp = (x + y) * (1.0 + (y / z));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[((-N[(x + y), $MachinePrecision]) / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+84], t$95$0, If[LessEqual[y, -22000000.0], N[(x + y), $MachinePrecision], If[LessEqual[y, -6.4e-62], N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[y, 2.95e-30], N[(N[(x + y), $MachinePrecision] * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \frac{-\left(x + y\right)}{y}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+84}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -22000000:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq -6.4 \cdot 10^{-62}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right)}{-y}\\

\mathbf{elif}\;y \leq 2.95 \cdot 10^{-30}:\\
\;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.1999999999999998e84 or 2.9499999999999999e-30 < y

    1. Initial program 67.2%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 72.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot \left(x + y\right)}{y}} \]
    4. Step-by-step derivation
      1. mul-1-neg72.6%

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in84.4%

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

        \[\leadsto z \cdot \color{blue}{\frac{x + y}{-y}} \]
      5. +-commutative84.4%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{-y} \]
    5. Simplified84.4%

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

    if -2.1999999999999998e84 < y < -2.2e7

    1. Initial program 94.4%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 65.9%

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative65.9%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified65.9%

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

    if -2.2e7 < y < -6.40000000000000043e-62

    1. Initial program 99.7%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 64.3%

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

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

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

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

    if -6.40000000000000043e-62 < y < 2.9499999999999999e-30

    1. Initial program 100.0%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 86.2%

      \[\leadsto \color{blue}{x + \left(y + \frac{y \cdot \left(x + y\right)}{z}\right)} \]
    4. Step-by-step derivation
      1. associate-+r+86.2%

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

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

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

        \[\leadsto \left(x + y\right) \cdot 1 + \color{blue}{\left(x + y\right) \cdot \frac{y}{z}} \]
      5. distribute-lft-in86.1%

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

        \[\leadsto \color{blue}{\left(y + x\right)} \cdot \left(1 + \frac{y}{z}\right) \]
    5. Simplified86.1%

      \[\leadsto \color{blue}{\left(y + x\right) \cdot \left(1 + \frac{y}{z}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification82.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+84}:\\ \;\;\;\;z \cdot \frac{-\left(x + y\right)}{y}\\ \mathbf{elif}\;y \leq -22000000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -6.4 \cdot 10^{-62}:\\ \;\;\;\;\frac{z \cdot \left(x + y\right)}{-y}\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{-30}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{-\left(x + y\right)}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \frac{-\left(x + y\right)}{y}\\ \mathbf{if}\;y \leq -2.2 \cdot 10^{+84}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -105000000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-62}:\\ \;\;\;\;\frac{z \cdot \left(x + y\right)}{-y}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-31}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (/ (- (+ x y)) y))))
   (if (<= y -2.2e+84)
     t_0
     (if (<= y -105000000.0)
       (+ x y)
       (if (<= y -4.4e-62)
         (/ (* z (+ x y)) (- y))
         (if (<= y 9e-31) (+ x y) t_0))))))
double code(double x, double y, double z) {
	double t_0 = z * (-(x + y) / y);
	double tmp;
	if (y <= -2.2e+84) {
		tmp = t_0;
	} else if (y <= -105000000.0) {
		tmp = x + y;
	} else if (y <= -4.4e-62) {
		tmp = (z * (x + y)) / -y;
	} else if (y <= 9e-31) {
		tmp = x + y;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = z * (-(x + y) / y)
    if (y <= (-2.2d+84)) then
        tmp = t_0
    else if (y <= (-105000000.0d0)) then
        tmp = x + y
    else if (y <= (-4.4d-62)) then
        tmp = (z * (x + y)) / -y
    else if (y <= 9d-31) then
        tmp = x + y
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * (-(x + y) / y);
	double tmp;
	if (y <= -2.2e+84) {
		tmp = t_0;
	} else if (y <= -105000000.0) {
		tmp = x + y;
	} else if (y <= -4.4e-62) {
		tmp = (z * (x + y)) / -y;
	} else if (y <= 9e-31) {
		tmp = x + y;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (-(x + y) / y)
	tmp = 0
	if y <= -2.2e+84:
		tmp = t_0
	elif y <= -105000000.0:
		tmp = x + y
	elif y <= -4.4e-62:
		tmp = (z * (x + y)) / -y
	elif y <= 9e-31:
		tmp = x + y
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(Float64(-Float64(x + y)) / y))
	tmp = 0.0
	if (y <= -2.2e+84)
		tmp = t_0;
	elseif (y <= -105000000.0)
		tmp = Float64(x + y);
	elseif (y <= -4.4e-62)
		tmp = Float64(Float64(z * Float64(x + y)) / Float64(-y));
	elseif (y <= 9e-31)
		tmp = Float64(x + y);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * (-(x + y) / y);
	tmp = 0.0;
	if (y <= -2.2e+84)
		tmp = t_0;
	elseif (y <= -105000000.0)
		tmp = x + y;
	elseif (y <= -4.4e-62)
		tmp = (z * (x + y)) / -y;
	elseif (y <= 9e-31)
		tmp = x + y;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[((-N[(x + y), $MachinePrecision]) / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+84], t$95$0, If[LessEqual[y, -105000000.0], N[(x + y), $MachinePrecision], If[LessEqual[y, -4.4e-62], N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / (-y)), $MachinePrecision], If[LessEqual[y, 9e-31], N[(x + y), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \frac{-\left(x + y\right)}{y}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+84}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -105000000:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq -4.4 \cdot 10^{-62}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right)}{-y}\\

\mathbf{elif}\;y \leq 9 \cdot 10^{-31}:\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.1999999999999998e84 or 9.0000000000000008e-31 < y

    1. Initial program 67.2%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 72.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot \left(x + y\right)}{y}} \]
    4. Step-by-step derivation
      1. mul-1-neg72.6%

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in84.4%

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

        \[\leadsto z \cdot \color{blue}{\frac{x + y}{-y}} \]
      5. +-commutative84.4%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{-y} \]
    5. Simplified84.4%

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

    if -2.1999999999999998e84 < y < -1.05e8 or -4.40000000000000035e-62 < y < 9.0000000000000008e-31

    1. Initial program 99.2%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 82.5%

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative82.5%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified82.5%

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

    if -1.05e8 < y < -4.40000000000000035e-62

    1. Initial program 99.7%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 64.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+84}:\\ \;\;\;\;z \cdot \frac{-\left(x + y\right)}{y}\\ \mathbf{elif}\;y \leq -105000000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-62}:\\ \;\;\;\;\frac{z \cdot \left(x + y\right)}{-y}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-31}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{-\left(x + y\right)}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 69.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ \mathbf{if}\;y \leq -1.02 \cdot 10^{+138}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{+38}:\\ \;\;\;\;\frac{y}{t\_0}\\ \mathbf{elif}\;y \leq -1.42 \cdot 10^{-98}:\\ \;\;\;\;\frac{x}{t\_0}\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{+72}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- 1.0 (/ y z))))
   (if (<= y -1.02e+138)
     (- z)
     (if (<= y -1.4e+38)
       (/ y t_0)
       (if (<= y -1.42e-98) (/ x t_0) (if (<= y 3.1e+72) (+ x y) (- z)))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double tmp;
	if (y <= -1.02e+138) {
		tmp = -z;
	} else if (y <= -1.4e+38) {
		tmp = y / t_0;
	} else if (y <= -1.42e-98) {
		tmp = x / t_0;
	} else if (y <= 3.1e+72) {
		tmp = x + y;
	} else {
		tmp = -z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 - (y / z)
    if (y <= (-1.02d+138)) then
        tmp = -z
    else if (y <= (-1.4d+38)) then
        tmp = y / t_0
    else if (y <= (-1.42d-98)) then
        tmp = x / t_0
    else if (y <= 3.1d+72) then
        tmp = x + y
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double tmp;
	if (y <= -1.02e+138) {
		tmp = -z;
	} else if (y <= -1.4e+38) {
		tmp = y / t_0;
	} else if (y <= -1.42e-98) {
		tmp = x / t_0;
	} else if (y <= 3.1e+72) {
		tmp = x + y;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	tmp = 0
	if y <= -1.02e+138:
		tmp = -z
	elif y <= -1.4e+38:
		tmp = y / t_0
	elif y <= -1.42e-98:
		tmp = x / t_0
	elif y <= 3.1e+72:
		tmp = x + y
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	tmp = 0.0
	if (y <= -1.02e+138)
		tmp = Float64(-z);
	elseif (y <= -1.4e+38)
		tmp = Float64(y / t_0);
	elseif (y <= -1.42e-98)
		tmp = Float64(x / t_0);
	elseif (y <= 3.1e+72)
		tmp = Float64(x + y);
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 1.0 - (y / z);
	tmp = 0.0;
	if (y <= -1.02e+138)
		tmp = -z;
	elseif (y <= -1.4e+38)
		tmp = y / t_0;
	elseif (y <= -1.42e-98)
		tmp = x / t_0;
	elseif (y <= 3.1e+72)
		tmp = x + y;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e+138], (-z), If[LessEqual[y, -1.4e+38], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -1.42e-98], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 3.1e+72], N[(x + y), $MachinePrecision], (-z)]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{+138}:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq -1.4 \cdot 10^{+38}:\\
\;\;\;\;\frac{y}{t\_0}\\

\mathbf{elif}\;y \leq -1.42 \cdot 10^{-98}:\\
\;\;\;\;\frac{x}{t\_0}\\

\mathbf{elif}\;y \leq 3.1 \cdot 10^{+72}:\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;-z\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.02e138 or 3.09999999999999988e72 < y

    1. Initial program 59.6%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 73.5%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-neg73.5%

        \[\leadsto \color{blue}{-z} \]
    5. Simplified73.5%

      \[\leadsto \color{blue}{-z} \]

    if -1.02e138 < y < -1.4e38

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 73.4%

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

    if -1.4e38 < y < -1.41999999999999999e-98

    1. Initial program 96.8%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 61.1%

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

    if -1.41999999999999999e-98 < y < 3.09999999999999988e72

    1. Initial program 98.4%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 78.0%

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative78.0%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified78.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.02 \cdot 10^{+138}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{+38}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -1.42 \cdot 10^{-98}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{+72}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 68.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.9 \cdot 10^{+113} \lor \neg \left(y \leq 1.85 \cdot 10^{+76}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.90000000000000023e113 or 1.85e76 < y

    1. Initial program 60.5%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 73.2%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-neg73.2%

        \[\leadsto \color{blue}{-z} \]
    5. Simplified73.2%

      \[\leadsto \color{blue}{-z} \]

    if -5.90000000000000023e113 < y < 1.85e76

    1. Initial program 98.2%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 71.2%

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative71.2%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified71.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.9 \cdot 10^{+113} \lor \neg \left(y \leq 1.85 \cdot 10^{+76}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 58.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+39} \lor \neg \left(y \leq 5.2 \cdot 10^{-39}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.05000000000000002e39 or 5.2e-39 < y

    1. Initial program 69.7%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 61.4%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-neg61.4%

        \[\leadsto \color{blue}{-z} \]
    5. Simplified61.4%

      \[\leadsto \color{blue}{-z} \]

    if -2.05000000000000002e39 < y < 5.2e-39

    1. Initial program 99.2%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 62.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+39} \lor \neg \left(y \leq 5.2 \cdot 10^{-39}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 40.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{-202}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-138}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -1.5e-202) x (if (<= x 1.8e-138) y x)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.5e-202) {
		tmp = x;
	} else if (x <= 1.8e-138) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-1.5d-202)) then
        tmp = x
    else if (x <= 1.8d-138) then
        tmp = y
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -1.5e-202) {
		tmp = x;
	} else if (x <= 1.8e-138) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -1.5e-202:
		tmp = x
	elif x <= 1.8e-138:
		tmp = y
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -1.5e-202)
		tmp = x;
	elseif (x <= 1.8e-138)
		tmp = y;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -1.5e-202)
		tmp = x;
	elseif (x <= 1.8e-138)
		tmp = y;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -1.5e-202], x, If[LessEqual[x, 1.8e-138], y, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{-202}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.8 \cdot 10^{-138}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.50000000000000005e-202 or 1.80000000000000009e-138 < x

    1. Initial program 84.0%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 44.5%

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

    if -1.50000000000000005e-202 < x < 1.80000000000000009e-138

    1. Initial program 88.7%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 75.7%

      \[\leadsto \color{blue}{\frac{y}{1 - \frac{y}{z}}} \]
    4. Taylor expanded in y around 0 43.4%

      \[\leadsto \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 35.6% accurate, 9.0× speedup?

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

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

    \[\frac{x + y}{1 - \frac{y}{z}} \]
  2. Add Preprocessing
  3. Taylor expanded in y around 0 37.0%

    \[\leadsto \color{blue}{x} \]
  4. Add Preprocessing

Developer target: 94.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y + x}{-y} \cdot z\\ \mathbf{if}\;y < -3.7429310762689856 \cdot 10^{+171}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y < 3.5534662456086734 \cdot 10^{+168}:\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (/ (+ y x) (- y)) z)))
   (if (< y -3.7429310762689856e+171)
     t_0
     (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) t_0))))
double code(double x, double y, double z) {
	double t_0 = ((y + x) / -y) * z;
	double tmp;
	if (y < -3.7429310762689856e+171) {
		tmp = t_0;
	} else if (y < 3.5534662456086734e+168) {
		tmp = (x + y) / (1.0 - (y / z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((y + x) / -y) * z
    if (y < (-3.7429310762689856d+171)) then
        tmp = t_0
    else if (y < 3.5534662456086734d+168) then
        tmp = (x + y) / (1.0d0 - (y / z))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = ((y + x) / -y) * z;
	double tmp;
	if (y < -3.7429310762689856e+171) {
		tmp = t_0;
	} else if (y < 3.5534662456086734e+168) {
		tmp = (x + y) / (1.0 - (y / z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = ((y + x) / -y) * z
	tmp = 0
	if y < -3.7429310762689856e+171:
		tmp = t_0
	elif y < 3.5534662456086734e+168:
		tmp = (x + y) / (1.0 - (y / z))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(y + x) / Float64(-y)) * z)
	tmp = 0.0
	if (y < -3.7429310762689856e+171)
		tmp = t_0;
	elseif (y < 3.5534662456086734e+168)
		tmp = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = ((y + x) / -y) * z;
	tmp = 0.0;
	if (y < -3.7429310762689856e+171)
		tmp = t_0;
	elseif (y < 3.5534662456086734e+168)
		tmp = (x + y) / (1.0 - (y / z));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + x), $MachinePrecision] / (-y)), $MachinePrecision] * z), $MachinePrecision]}, If[Less[y, -3.7429310762689856e+171], t$95$0, If[Less[y, 3.5534662456086734e+168], N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y + x}{-y} \cdot z\\
\mathbf{if}\;y < -3.7429310762689856 \cdot 10^{+171}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y < 3.5534662456086734 \cdot 10^{+168}:\\
\;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024085 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
  :precision binary64

  :alt
  (if (< y -3.7429310762689856e+171) (* (/ (+ y x) (- y)) z) (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) (* (/ (+ y x) (- y)) z)))

  (/ (+ x y) (- 1.0 (/ y z))))