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

Percentage Accurate: 88.3% → 99.4%
Time: 8.2s
Alternatives: 12
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 12 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.3% 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.3× 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 -2 \cdot 10^{-256}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0} \cdot \left(x + y\right)\\ \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 -2e-256)
     t_1
     (if (<= t_1 0.0) (* z (- -1.0 (/ x y))) (* (/ 1.0 t_0) (+ x y))))))
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 <= -2e-256) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = z * (-1.0 - (x / y));
	} else {
		tmp = (1.0 / t_0) * (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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 - (y / z)
    t_1 = (x + y) / t_0
    if (t_1 <= (-2d-256)) then
        tmp = t_1
    else if (t_1 <= 0.0d0) then
        tmp = z * ((-1.0d0) - (x / y))
    else
        tmp = (1.0d0 / t_0) * (x + y)
    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 <= -2e-256) {
		tmp = t_1;
	} else if (t_1 <= 0.0) {
		tmp = z * (-1.0 - (x / y));
	} else {
		tmp = (1.0 / t_0) * (x + y);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	t_1 = (x + y) / t_0
	tmp = 0
	if t_1 <= -2e-256:
		tmp = t_1
	elif t_1 <= 0.0:
		tmp = z * (-1.0 - (x / y))
	else:
		tmp = (1.0 / t_0) * (x + y)
	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 <= -2e-256)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = Float64(z * Float64(-1.0 - Float64(x / y)));
	else
		tmp = Float64(Float64(1.0 / t_0) * Float64(x + y));
	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 <= -2e-256)
		tmp = t_1;
	elseif (t_1 <= 0.0)
		tmp = z * (-1.0 - (x / y));
	else
		tmp = (1.0 / t_0) * (x + y);
	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, -2e-256], t$95$1, If[LessEqual[t$95$1, 0.0], N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{x + y}{t_0}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-256}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -1.99999999999999995e-256

    1. Initial program 99.8%

      \[\frac{x + y}{1 - \frac{y}{z}} \]

    if -1.99999999999999995e-256 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0

    1. Initial program 6.0%

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

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

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

        \[\leadsto -\color{blue}{\frac{y + x}{\frac{y}{z}}} \]
      3. +-commutative6.0%

        \[\leadsto -\frac{\color{blue}{x + y}}{\frac{y}{z}} \]
      4. associate-/r/100.0%

        \[\leadsto -\color{blue}{\frac{x + y}{y} \cdot z} \]
      5. distribute-rgt-neg-in100.0%

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

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

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

      \[\leadsto \color{blue}{\left(1 + \frac{x}{y}\right)} \cdot \left(-z\right) \]
    6. Taylor expanded in x around 0 99.9%

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

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

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

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

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

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

        \[\leadsto -\left(z + \color{blue}{\frac{z \cdot x}{y}}\right) \]
      7. *-lft-identity99.9%

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

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

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

        \[\leadsto -\left(1 \cdot z + \color{blue}{\frac{x}{y} \cdot z}\right) \]
      11. distribute-rgt-in100.0%

        \[\leadsto -\color{blue}{z \cdot \left(1 + \frac{x}{y}\right)} \]
      12. distribute-rgt-neg-in100.0%

        \[\leadsto \color{blue}{z \cdot \left(-\left(1 + \frac{x}{y}\right)\right)} \]
      13. distribute-neg-in100.0%

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

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

        \[\leadsto z \cdot \color{blue}{\left(-1 - \frac{x}{y}\right)} \]
    8. Simplified100.0%

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

    if 0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z)))

    1. Initial program 99.8%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. 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)} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{1}{1 - \frac{y}{z}} \cdot \left(x + y\right)} \]
  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 -2 \cdot 10^{-256}:\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;\frac{x + y}{1 - \frac{y}{z}} \leq 0:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{1 - \frac{y}{z}} \cdot \left(x + y\right)\\ \end{array} \]

Alternative 2: 99.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{if}\;t_0 \leq -2 \cdot 10^{-256} \lor \neg \left(t_0 \leq 0\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z)))))
   (if (or (<= t_0 -2e-256) (not (<= t_0 0.0))) t_0 (* z (- -1.0 (/ x y))))))
double code(double x, double y, double z) {
	double t_0 = (x + y) / (1.0 - (y / z));
	double tmp;
	if ((t_0 <= -2e-256) || !(t_0 <= 0.0)) {
		tmp = t_0;
	} else {
		tmp = z * (-1.0 - (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) :: t_0
    real(8) :: tmp
    t_0 = (x + y) / (1.0d0 - (y / z))
    if ((t_0 <= (-2d-256)) .or. (.not. (t_0 <= 0.0d0))) then
        tmp = t_0
    else
        tmp = z * ((-1.0d0) - (x / 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 <= -2e-256) || !(t_0 <= 0.0)) {
		tmp = t_0;
	} else {
		tmp = z * (-1.0 - (x / y));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x + y) / (1.0 - (y / z))
	tmp = 0
	if (t_0 <= -2e-256) or not (t_0 <= 0.0):
		tmp = t_0
	else:
		tmp = z * (-1.0 - (x / 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 <= -2e-256) || !(t_0 <= 0.0))
		tmp = t_0;
	else
		tmp = Float64(z * Float64(-1.0 - Float64(x / 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 <= -2e-256) || ~((t_0 <= 0.0)))
		tmp = t_0;
	else
		tmp = z * (-1.0 - (x / 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, -2e-256], N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision]], t$95$0, N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -1.99999999999999995e-256 or 0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z)))

    1. Initial program 99.8%

      \[\frac{x + y}{1 - \frac{y}{z}} \]

    if -1.99999999999999995e-256 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0

    1. Initial program 6.0%

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

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

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

        \[\leadsto -\color{blue}{\frac{y + x}{\frac{y}{z}}} \]
      3. +-commutative6.0%

        \[\leadsto -\frac{\color{blue}{x + y}}{\frac{y}{z}} \]
      4. associate-/r/100.0%

        \[\leadsto -\color{blue}{\frac{x + y}{y} \cdot z} \]
      5. distribute-rgt-neg-in100.0%

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

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

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

      \[\leadsto \color{blue}{\left(1 + \frac{x}{y}\right)} \cdot \left(-z\right) \]
    6. Taylor expanded in x around 0 99.9%

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

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

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

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

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

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

        \[\leadsto -\left(z + \color{blue}{\frac{z \cdot x}{y}}\right) \]
      7. *-lft-identity99.9%

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

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

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

        \[\leadsto -\left(1 \cdot z + \color{blue}{\frac{x}{y} \cdot z}\right) \]
      11. distribute-rgt-in100.0%

        \[\leadsto -\color{blue}{z \cdot \left(1 + \frac{x}{y}\right)} \]
      12. distribute-rgt-neg-in100.0%

        \[\leadsto \color{blue}{z \cdot \left(-\left(1 + \frac{x}{y}\right)\right)} \]
      13. distribute-neg-in100.0%

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

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

        \[\leadsto z \cdot \color{blue}{\left(-1 - \frac{x}{y}\right)} \]
    8. Simplified100.0%

      \[\leadsto \color{blue}{z \cdot \left(-1 - \frac{x}{y}\right)} \]
  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 -2 \cdot 10^{-256} \lor \neg \left(\frac{x + y}{1 - \frac{y}{z}} \leq 0\right):\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]

Alternative 3: 73.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{1 - \frac{y}{z}}\\ t_1 := \frac{1}{\frac{1}{y} + \frac{-1}{z}}\\ \mathbf{if}\;y \leq -1.25 \cdot 10^{+61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.65 \cdot 10^{-92}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-206}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-36}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ x (- 1.0 (/ y z)))) (t_1 (/ 1.0 (+ (/ 1.0 y) (/ -1.0 z)))))
   (if (<= y -1.25e+61)
     t_1
     (if (<= y -1.65e-92)
       t_0
       (if (<= y -3.4e-206)
         (* (+ x y) (+ 1.0 (/ y z)))
         (if (<= y 2.2e-36) t_0 t_1))))))
double code(double x, double y, double z) {
	double t_0 = x / (1.0 - (y / z));
	double t_1 = 1.0 / ((1.0 / y) + (-1.0 / z));
	double tmp;
	if (y <= -1.25e+61) {
		tmp = t_1;
	} else if (y <= -1.65e-92) {
		tmp = t_0;
	} else if (y <= -3.4e-206) {
		tmp = (x + y) * (1.0 + (y / z));
	} else if (y <= 2.2e-36) {
		tmp = t_0;
	} 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 = x / (1.0d0 - (y / z))
    t_1 = 1.0d0 / ((1.0d0 / y) + ((-1.0d0) / z))
    if (y <= (-1.25d+61)) then
        tmp = t_1
    else if (y <= (-1.65d-92)) then
        tmp = t_0
    else if (y <= (-3.4d-206)) then
        tmp = (x + y) * (1.0d0 + (y / z))
    else if (y <= 2.2d-36) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x / (1.0 - (y / z));
	double t_1 = 1.0 / ((1.0 / y) + (-1.0 / z));
	double tmp;
	if (y <= -1.25e+61) {
		tmp = t_1;
	} else if (y <= -1.65e-92) {
		tmp = t_0;
	} else if (y <= -3.4e-206) {
		tmp = (x + y) * (1.0 + (y / z));
	} else if (y <= 2.2e-36) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x / (1.0 - (y / z))
	t_1 = 1.0 / ((1.0 / y) + (-1.0 / z))
	tmp = 0
	if y <= -1.25e+61:
		tmp = t_1
	elif y <= -1.65e-92:
		tmp = t_0
	elif y <= -3.4e-206:
		tmp = (x + y) * (1.0 + (y / z))
	elif y <= 2.2e-36:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(x / Float64(1.0 - Float64(y / z)))
	t_1 = Float64(1.0 / Float64(Float64(1.0 / y) + Float64(-1.0 / z)))
	tmp = 0.0
	if (y <= -1.25e+61)
		tmp = t_1;
	elseif (y <= -1.65e-92)
		tmp = t_0;
	elseif (y <= -3.4e-206)
		tmp = Float64(Float64(x + y) * Float64(1.0 + Float64(y / z)));
	elseif (y <= 2.2e-36)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x / (1.0 - (y / z));
	t_1 = 1.0 / ((1.0 / y) + (-1.0 / z));
	tmp = 0.0;
	if (y <= -1.25e+61)
		tmp = t_1;
	elseif (y <= -1.65e-92)
		tmp = t_0;
	elseif (y <= -3.4e-206)
		tmp = (x + y) * (1.0 + (y / z));
	elseif (y <= 2.2e-36)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(N[(1.0 / y), $MachinePrecision] + N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+61], t$95$1, If[LessEqual[y, -1.65e-92], t$95$0, If[LessEqual[y, -3.4e-206], N[(N[(x + y), $MachinePrecision] * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-36], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{1 - \frac{y}{z}}\\
t_1 := \frac{1}{\frac{1}{y} + \frac{-1}{z}}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+61}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.65 \cdot 10^{-92}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq 2.2 \cdot 10^{-36}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.25000000000000004e61 or 2.1999999999999999e-36 < y

    1. Initial program 74.7%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Step-by-step derivation
      1. clear-num74.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{1 - \frac{y}{z}}{x + y}}} \]
      2. inv-pow74.4%

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

      \[\leadsto \color{blue}{{\left(\frac{1 - \frac{y}{z}}{x + y}\right)}^{-1}} \]
    4. Taylor expanded in z around 0 85.3%

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\frac{1}{x + y} - \frac{y}{z \cdot \left(x + y\right)}\right)}}^{-1} \]
    7. Taylor expanded in x around 0 82.3%

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

    if -1.25000000000000004e61 < y < -1.64999999999999999e-92 or -3.39999999999999985e-206 < y < 2.1999999999999999e-36

    1. Initial program 99.0%

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

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

    if -1.64999999999999999e-92 < y < -3.39999999999999985e-206

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+61}:\\ \;\;\;\;\frac{1}{\frac{1}{y} + \frac{-1}{z}}\\ \mathbf{elif}\;y \leq -1.65 \cdot 10^{-92}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-206}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-36}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{1}{y} + \frac{-1}{z}}\\ \end{array} \]

Alternative 4: 72.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ t_1 := z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -3.5 \cdot 10^{+63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{t_0}\\ \mathbf{elif}\;y \leq 9.7 \cdot 10^{+176} \lor \neg \left(y \leq 7.2 \cdot 10^{+212}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t_0}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- 1.0 (/ y z))) (t_1 (* z (- -1.0 (/ x y)))))
   (if (<= y -3.5e+63)
     t_1
     (if (<= y 3.2e-16)
       (/ x t_0)
       (if (or (<= y 9.7e+176) (not (<= y 7.2e+212))) t_1 (/ y t_0))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double t_1 = z * (-1.0 - (x / y));
	double tmp;
	if (y <= -3.5e+63) {
		tmp = t_1;
	} else if (y <= 3.2e-16) {
		tmp = x / t_0;
	} else if ((y <= 9.7e+176) || !(y <= 7.2e+212)) {
		tmp = t_1;
	} else {
		tmp = y / 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) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 - (y / z)
    t_1 = z * ((-1.0d0) - (x / y))
    if (y <= (-3.5d+63)) then
        tmp = t_1
    else if (y <= 3.2d-16) then
        tmp = x / t_0
    else if ((y <= 9.7d+176) .or. (.not. (y <= 7.2d+212))) then
        tmp = t_1
    else
        tmp = y / t_0
    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 = z * (-1.0 - (x / y));
	double tmp;
	if (y <= -3.5e+63) {
		tmp = t_1;
	} else if (y <= 3.2e-16) {
		tmp = x / t_0;
	} else if ((y <= 9.7e+176) || !(y <= 7.2e+212)) {
		tmp = t_1;
	} else {
		tmp = y / t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	t_1 = z * (-1.0 - (x / y))
	tmp = 0
	if y <= -3.5e+63:
		tmp = t_1
	elif y <= 3.2e-16:
		tmp = x / t_0
	elif (y <= 9.7e+176) or not (y <= 7.2e+212):
		tmp = t_1
	else:
		tmp = y / t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	t_1 = Float64(z * Float64(-1.0 - Float64(x / y)))
	tmp = 0.0
	if (y <= -3.5e+63)
		tmp = t_1;
	elseif (y <= 3.2e-16)
		tmp = Float64(x / t_0);
	elseif ((y <= 9.7e+176) || !(y <= 7.2e+212))
		tmp = t_1;
	else
		tmp = Float64(y / t_0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 1.0 - (y / z);
	t_1 = z * (-1.0 - (x / y));
	tmp = 0.0;
	if (y <= -3.5e+63)
		tmp = t_1;
	elseif (y <= 3.2e-16)
		tmp = x / t_0;
	elseif ((y <= 9.7e+176) || ~((y <= 7.2e+212)))
		tmp = t_1;
	else
		tmp = y / t_0;
	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[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+63], t$95$1, If[LessEqual[y, 3.2e-16], N[(x / t$95$0), $MachinePrecision], If[Or[LessEqual[y, 9.7e+176], N[Not[LessEqual[y, 7.2e+212]], $MachinePrecision]], t$95$1, N[(y / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 3.2 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{t_0}\\

\mathbf{elif}\;y \leq 9.7 \cdot 10^{+176} \lor \neg \left(y \leq 7.2 \cdot 10^{+212}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{t_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.50000000000000029e63 or 3.20000000000000023e-16 < y < 9.70000000000000041e176 or 7.2e212 < y

    1. Initial program 71.8%

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

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

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

        \[\leadsto -\color{blue}{\frac{y + x}{\frac{y}{z}}} \]
      3. +-commutative50.9%

        \[\leadsto -\frac{\color{blue}{x + y}}{\frac{y}{z}} \]
      4. associate-/r/78.9%

        \[\leadsto -\color{blue}{\frac{x + y}{y} \cdot z} \]
      5. distribute-rgt-neg-in78.9%

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

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

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

      \[\leadsto \color{blue}{\left(1 + \frac{x}{y}\right)} \cdot \left(-z\right) \]
    6. Taylor expanded in x around 0 76.0%

      \[\leadsto \color{blue}{-1 \cdot z + -1 \cdot \frac{z \cdot x}{y}} \]
    7. Step-by-step derivation
      1. distribute-lft-out76.0%

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

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

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

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

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

        \[\leadsto -\left(z + \color{blue}{\frac{z \cdot x}{y}}\right) \]
      7. *-lft-identity76.0%

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

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

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

        \[\leadsto -\left(1 \cdot z + \color{blue}{\frac{x}{y} \cdot z}\right) \]
      11. distribute-rgt-in79.0%

        \[\leadsto -\color{blue}{z \cdot \left(1 + \frac{x}{y}\right)} \]
      12. distribute-rgt-neg-in79.0%

        \[\leadsto \color{blue}{z \cdot \left(-\left(1 + \frac{x}{y}\right)\right)} \]
      13. distribute-neg-in79.0%

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

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

        \[\leadsto z \cdot \color{blue}{\left(-1 - \frac{x}{y}\right)} \]
    8. Simplified79.0%

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

    if -3.50000000000000029e63 < y < 3.20000000000000023e-16

    1. Initial program 99.2%

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

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

    if 9.70000000000000041e176 < y < 7.2e212

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{\frac{y}{1 - \frac{y}{z}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+63}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 9.7 \cdot 10^{+176} \lor \neg \left(y \leq 7.2 \cdot 10^{+212}\right):\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \end{array} \]

Alternative 5: 72.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ t_1 := \left(-z\right) - \frac{z}{\frac{y}{x}}\\ \mathbf{if}\;y \leq -1.25 \cdot 10^{+61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{t_0}\\ \mathbf{elif}\;y \leq 4.05 \cdot 10^{+173}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+212}:\\ \;\;\;\;\frac{y}{t_0}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- 1.0 (/ y z))) (t_1 (- (- z) (/ z (/ y x)))))
   (if (<= y -1.25e+61)
     t_1
     (if (<= y 1.35e-16)
       (/ x t_0)
       (if (<= y 4.05e+173)
         t_1
         (if (<= y 5.8e+212) (/ y t_0) (* z (- -1.0 (/ x y)))))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double t_1 = -z - (z / (y / x));
	double tmp;
	if (y <= -1.25e+61) {
		tmp = t_1;
	} else if (y <= 1.35e-16) {
		tmp = x / t_0;
	} else if (y <= 4.05e+173) {
		tmp = t_1;
	} else if (y <= 5.8e+212) {
		tmp = y / t_0;
	} else {
		tmp = z * (-1.0 - (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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 - (y / z)
    t_1 = -z - (z / (y / x))
    if (y <= (-1.25d+61)) then
        tmp = t_1
    else if (y <= 1.35d-16) then
        tmp = x / t_0
    else if (y <= 4.05d+173) then
        tmp = t_1
    else if (y <= 5.8d+212) then
        tmp = y / t_0
    else
        tmp = z * ((-1.0d0) - (x / y))
    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 = -z - (z / (y / x));
	double tmp;
	if (y <= -1.25e+61) {
		tmp = t_1;
	} else if (y <= 1.35e-16) {
		tmp = x / t_0;
	} else if (y <= 4.05e+173) {
		tmp = t_1;
	} else if (y <= 5.8e+212) {
		tmp = y / t_0;
	} else {
		tmp = z * (-1.0 - (x / y));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	t_1 = -z - (z / (y / x))
	tmp = 0
	if y <= -1.25e+61:
		tmp = t_1
	elif y <= 1.35e-16:
		tmp = x / t_0
	elif y <= 4.05e+173:
		tmp = t_1
	elif y <= 5.8e+212:
		tmp = y / t_0
	else:
		tmp = z * (-1.0 - (x / y))
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	t_1 = Float64(Float64(-z) - Float64(z / Float64(y / x)))
	tmp = 0.0
	if (y <= -1.25e+61)
		tmp = t_1;
	elseif (y <= 1.35e-16)
		tmp = Float64(x / t_0);
	elseif (y <= 4.05e+173)
		tmp = t_1;
	elseif (y <= 5.8e+212)
		tmp = Float64(y / t_0);
	else
		tmp = Float64(z * Float64(-1.0 - Float64(x / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 1.0 - (y / z);
	t_1 = -z - (z / (y / x));
	tmp = 0.0;
	if (y <= -1.25e+61)
		tmp = t_1;
	elseif (y <= 1.35e-16)
		tmp = x / t_0;
	elseif (y <= 4.05e+173)
		tmp = t_1;
	elseif (y <= 5.8e+212)
		tmp = y / t_0;
	else
		tmp = z * (-1.0 - (x / y));
	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[((-z) - N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+61], t$95$1, If[LessEqual[y, 1.35e-16], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 4.05e+173], t$95$1, If[LessEqual[y, 5.8e+212], N[(y / t$95$0), $MachinePrecision], N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 1.35 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{t_0}\\

\mathbf{elif}\;y \leq 4.05 \cdot 10^{+173}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 5.8 \cdot 10^{+212}:\\
\;\;\;\;\frac{y}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.25000000000000004e61 or 1.35e-16 < y < 4.05000000000000018e173

    1. Initial program 76.2%

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

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

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

        \[\leadsto -\color{blue}{\frac{y + x}{\frac{y}{z}}} \]
      3. +-commutative53.5%

        \[\leadsto -\frac{\color{blue}{x + y}}{\frac{y}{z}} \]
      4. associate-/r/77.1%

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

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

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

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

      \[\leadsto \color{blue}{\left(1 + \frac{x}{y}\right)} \cdot \left(-z\right) \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-out77.1%

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

        \[\leadsto -\left(1 + \frac{x}{y}\right) \cdot \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \]
      3. sqrt-unprod25.9%

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

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

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

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

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

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

        \[\leadsto -\left(\color{blue}{\left(-z\right)} + \frac{x}{y} \cdot \left(-z\right)\right) \]
      10. add-sqr-sqrt1.7%

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

        \[\leadsto -\left(\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} + \frac{x}{y} \cdot \left(-z\right)\right) \]
      12. sqr-neg21.8%

        \[\leadsto -\left(\sqrt{\color{blue}{z \cdot z}} + \frac{x}{y} \cdot \left(-z\right)\right) \]
      13. sqrt-unprod31.0%

        \[\leadsto -\left(\color{blue}{\sqrt{z} \cdot \sqrt{z}} + \frac{x}{y} \cdot \left(-z\right)\right) \]
      14. add-sqr-sqrt59.5%

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

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

        \[\leadsto -\left(z + \left(-z\right) \cdot \color{blue}{\frac{1}{\frac{y}{x}}}\right) \]
      17. un-div-inv59.5%

        \[\leadsto -\left(z + \color{blue}{\frac{-z}{\frac{y}{x}}}\right) \]
      18. add-sqr-sqrt28.3%

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

        \[\leadsto -\left(z + \frac{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}}{\frac{y}{x}}\right) \]
      20. sqr-neg59.1%

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

        \[\leadsto -\left(z + \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\frac{y}{x}}\right) \]
      22. add-sqr-sqrt77.1%

        \[\leadsto -\left(z + \frac{\color{blue}{z}}{\frac{y}{x}}\right) \]
    7. Applied egg-rr77.1%

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

    if -1.25000000000000004e61 < y < 1.35e-16

    1. Initial program 99.2%

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

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

    if 4.05000000000000018e173 < y < 5.7999999999999997e212

    1. Initial program 100.0%

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

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

    if 5.7999999999999997e212 < y

    1. Initial program 53.2%

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

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

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

        \[\leadsto -\color{blue}{\frac{y + x}{\frac{y}{z}}} \]
      3. +-commutative40.1%

        \[\leadsto -\frac{\color{blue}{x + y}}{\frac{y}{z}} \]
      4. associate-/r/86.8%

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

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

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

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

      \[\leadsto \color{blue}{\left(1 + \frac{x}{y}\right)} \cdot \left(-z\right) \]
    6. Taylor expanded in x around 0 86.8%

      \[\leadsto \color{blue}{-1 \cdot z + -1 \cdot \frac{z \cdot x}{y}} \]
    7. Step-by-step derivation
      1. distribute-lft-out86.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+61}:\\ \;\;\;\;\left(-z\right) - \frac{z}{\frac{y}{x}}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 4.05 \cdot 10^{+173}:\\ \;\;\;\;\left(-z\right) - \frac{z}{\frac{y}{x}}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+212}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]

Alternative 6: 73.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-76} \lor \neg \left(y \leq 1.8 \cdot 10^{-25}\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.19999999999999999e-76 or 1.8e-25 < y

    1. Initial program 77.9%

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

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

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

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

        \[\leadsto -\frac{\color{blue}{x + y}}{\frac{y}{z}} \]
      4. associate-/r/73.2%

        \[\leadsto -\color{blue}{\frac{x + y}{y} \cdot z} \]
      5. distribute-rgt-neg-in73.2%

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

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

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

      \[\leadsto \color{blue}{\left(1 + \frac{x}{y}\right)} \cdot \left(-z\right) \]
    6. Taylor expanded in x around 0 71.5%

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

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

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

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

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

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

        \[\leadsto -\left(z + \color{blue}{\frac{z \cdot x}{y}}\right) \]
      7. *-lft-identity71.5%

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

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

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

        \[\leadsto -\left(1 \cdot z + \color{blue}{\frac{x}{y} \cdot z}\right) \]
      11. distribute-rgt-in73.2%

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

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

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

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

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

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

    if -2.19999999999999999e-76 < y < 1.8e-25

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{-76} \lor \neg \left(y \leq 1.8 \cdot 10^{-25}\right):\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 7: 73.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+61} \lor \neg \left(y \leq 2.05 \cdot 10^{-13}\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.25000000000000004e61 or 2.0500000000000001e-13 < y

    1. Initial program 73.9%

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

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

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

        \[\leadsto -\color{blue}{\frac{y + x}{\frac{y}{z}}} \]
      3. +-commutative50.5%

        \[\leadsto -\frac{\color{blue}{x + y}}{\frac{y}{z}} \]
      4. associate-/r/76.6%

        \[\leadsto -\color{blue}{\frac{x + y}{y} \cdot z} \]
      5. distribute-rgt-neg-in76.6%

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

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

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

      \[\leadsto \color{blue}{\left(1 + \frac{x}{y}\right)} \cdot \left(-z\right) \]
    6. Taylor expanded in x around 0 73.8%

      \[\leadsto \color{blue}{-1 \cdot z + -1 \cdot \frac{z \cdot x}{y}} \]
    7. Step-by-step derivation
      1. distribute-lft-out73.8%

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

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

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

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

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

        \[\leadsto -\left(z + \color{blue}{\frac{z \cdot x}{y}}\right) \]
      7. *-lft-identity73.8%

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \left(1 + \frac{x}{y}\right)} \]
      12. distribute-rgt-neg-in76.6%

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

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

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

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

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

    if -1.25000000000000004e61 < y < 2.0500000000000001e-13

    1. Initial program 99.2%

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

      \[\leadsto \color{blue}{\frac{x}{1 - \frac{y}{z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+61} \lor \neg \left(y \leq 2.05 \cdot 10^{-13}\right):\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \end{array} \]

Alternative 8: 63.9% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq -2.35 \cdot 10^{-74}:\\
\;\;\;\;x \cdot \frac{-z}{y}\\

\mathbf{elif}\;y \leq 2.8 \cdot 10^{-5}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.61999999999999996e61 or 2.79999999999999996e-5 < y

    1. Initial program 73.4%

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

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

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

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

    if -1.61999999999999996e61 < y < -2.35000000000000005e-74

    1. Initial program 95.9%

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

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

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

        \[\leadsto -\color{blue}{\frac{y + x}{\frac{y}{z}}} \]
      3. +-commutative61.7%

        \[\leadsto -\frac{\color{blue}{x + y}}{\frac{y}{z}} \]
      4. distribute-neg-frac61.7%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-y\right) - x}}{\frac{y}{z}} \]
    4. Simplified61.7%

      \[\leadsto \color{blue}{\frac{\left(-y\right) - x}{\frac{y}{z}}} \]
    5. Taylor expanded in y around 0 49.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{z \cdot x}{y}} \]
    6. Step-by-step derivation
      1. mul-1-neg49.9%

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

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

        \[\leadsto -\color{blue}{x \cdot \frac{z}{y}} \]
      4. *-commutative53.2%

        \[\leadsto -\color{blue}{\frac{z}{y} \cdot x} \]
      5. distribute-rgt-neg-in53.2%

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

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

    if -2.35000000000000005e-74 < y < 2.79999999999999996e-5

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.62 \cdot 10^{+61}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -2.35 \cdot 10^{-74}:\\ \;\;\;\;x \cdot \frac{-z}{y}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-5}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 9: 66.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+58}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-5}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -1.4e+58) (- z) (if (<= y 1.6e-5) (+ x y) (- z))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -1.4e+58) {
		tmp = -z;
	} else if (y <= 1.6e-5) {
		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) :: tmp
    if (y <= (-1.4d+58)) then
        tmp = -z
    else if (y <= 1.6d-5) then
        tmp = x + y
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -1.4e+58) {
		tmp = -z;
	} else if (y <= 1.6e-5) {
		tmp = x + y;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -1.4e+58:
		tmp = -z
	elif y <= 1.6e-5:
		tmp = x + y
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -1.4e+58)
		tmp = Float64(-z);
	elseif (y <= 1.6e-5)
		tmp = Float64(x + y);
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -1.4e+58)
		tmp = -z;
	elseif (y <= 1.6e-5)
		tmp = x + y;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -1.4e+58], (-z), If[LessEqual[y, 1.6e-5], N[(x + y), $MachinePrecision], (-z)]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 1.6 \cdot 10^{-5}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.3999999999999999e58 or 1.59999999999999993e-5 < y

    1. Initial program 73.6%

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

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

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

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

    if -1.3999999999999999e58 < y < 1.59999999999999993e-5

    1. Initial program 99.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+58}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-5}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 10: 57.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+57}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 10^{-11}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -4.8e+57) (- z) (if (<= y 1e-11) x (- z))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -4.8e+57) {
		tmp = -z;
	} else if (y <= 1e-11) {
		tmp = x;
	} 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) :: tmp
    if (y <= (-4.8d+57)) then
        tmp = -z
    else if (y <= 1d-11) then
        tmp = x
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -4.8e+57) {
		tmp = -z;
	} else if (y <= 1e-11) {
		tmp = x;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -4.8e+57:
		tmp = -z
	elif y <= 1e-11:
		tmp = x
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -4.8e+57)
		tmp = Float64(-z);
	elseif (y <= 1e-11)
		tmp = x;
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -4.8e+57)
		tmp = -z;
	elseif (y <= 1e-11)
		tmp = x;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -4.8e+57], (-z), If[LessEqual[y, 1e-11], x, (-z)]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 10^{-11}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.80000000000000009e57 or 9.99999999999999939e-12 < y

    1. Initial program 74.1%

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

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

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

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

    if -4.80000000000000009e57 < y < 9.99999999999999939e-12

    1. Initial program 99.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+57}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 10^{-11}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 11: 37.2% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+85}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -4.6e+85) y (if (<= y 1.95e-36) x y)))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -4.6e+85) {
		tmp = y;
	} else if (y <= 1.95e-36) {
		tmp = x;
	} else {
		tmp = 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 <= (-4.6d+85)) then
        tmp = y
    else if (y <= 1.95d-36) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -4.6e+85) {
		tmp = y;
	} else if (y <= 1.95e-36) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -4.6e+85:
		tmp = y
	elif y <= 1.95e-36:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -4.6e+85)
		tmp = y;
	elseif (y <= 1.95e-36)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -4.6e+85)
		tmp = y;
	elseif (y <= 1.95e-36)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -4.6e+85], y, If[LessEqual[y, 1.95e-36], x, y]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+85}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 1.95 \cdot 10^{-36}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5999999999999998e85 or 1.95e-36 < y

    1. Initial program 74.8%

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

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

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

    if -4.5999999999999998e85 < y < 1.95e-36

    1. Initial program 98.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+85}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-36}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 12: 33.9% 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 87.0%

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

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

    \[\leadsto x \]

Developer target: 93.6% accurate, 0.7× 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 2023174 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
  :precision binary64

  :herbie-target
  (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))))