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

Percentage Accurate: 88.3% → 99.6%
Time: 7.0s
Alternatives: 9
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 9 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.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-261} \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 -1e-261) (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 <= -1e-261) || !(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 <= (-1d-261)) .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 <= -1e-261) || !(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 <= -1e-261) 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 <= -1e-261) || !(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 <= -1e-261) || ~((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, -1e-261], 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 -1 \cdot 10^{-261} \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 #s(literal 1 binary64) (/.f64 y z))) < -9.99999999999999984e-262 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 -9.99999999999999984e-262 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < 0.0

    1. Initial program 16.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \frac{y + x}{-y}} \]
    6. Taylor expanded in z around 0 96.1%

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

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

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

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

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

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

        \[\leadsto \left(-z\right) \cdot \color{blue}{\left(x \cdot \frac{1}{y} + y \cdot \frac{1}{y}\right)} \]
      7. rgt-mult-inverse99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 -1 \cdot 10^{-261} \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} \]
  5. Add Preprocessing

Alternative 2: 73.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -1.2 \cdot 10^{+71}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-71}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{-210}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 1350 \lor \neg \left(y \leq 3.6 \cdot 10^{+59}\right) \land y \leq 4 \cdot 10^{+116}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (- -1.0 (/ x y)))))
   (if (<= y -1.2e+71)
     t_0
     (if (<= y -1e-71)
       (+ x y)
       (if (<= y -1.35e-210)
         (/ x (- 1.0 (/ y z)))
         (if (or (<= y 1350.0) (and (not (<= y 3.6e+59)) (<= y 4e+116)))
           (+ x y)
           t_0))))))
double code(double x, double y, double z) {
	double t_0 = z * (-1.0 - (x / y));
	double tmp;
	if (y <= -1.2e+71) {
		tmp = t_0;
	} else if (y <= -1e-71) {
		tmp = x + y;
	} else if (y <= -1.35e-210) {
		tmp = x / (1.0 - (y / z));
	} else if ((y <= 1350.0) || (!(y <= 3.6e+59) && (y <= 4e+116))) {
		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 * ((-1.0d0) - (x / y))
    if (y <= (-1.2d+71)) then
        tmp = t_0
    else if (y <= (-1d-71)) then
        tmp = x + y
    else if (y <= (-1.35d-210)) then
        tmp = x / (1.0d0 - (y / z))
    else if ((y <= 1350.0d0) .or. (.not. (y <= 3.6d+59)) .and. (y <= 4d+116)) 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 * (-1.0 - (x / y));
	double tmp;
	if (y <= -1.2e+71) {
		tmp = t_0;
	} else if (y <= -1e-71) {
		tmp = x + y;
	} else if (y <= -1.35e-210) {
		tmp = x / (1.0 - (y / z));
	} else if ((y <= 1350.0) || (!(y <= 3.6e+59) && (y <= 4e+116))) {
		tmp = x + y;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (-1.0 - (x / y))
	tmp = 0
	if y <= -1.2e+71:
		tmp = t_0
	elif y <= -1e-71:
		tmp = x + y
	elif y <= -1.35e-210:
		tmp = x / (1.0 - (y / z))
	elif (y <= 1350.0) or (not (y <= 3.6e+59) and (y <= 4e+116)):
		tmp = x + y
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(z * Float64(-1.0 - Float64(x / y)))
	tmp = 0.0
	if (y <= -1.2e+71)
		tmp = t_0;
	elseif (y <= -1e-71)
		tmp = Float64(x + y);
	elseif (y <= -1.35e-210)
		tmp = Float64(x / Float64(1.0 - Float64(y / z)));
	elseif ((y <= 1350.0) || (!(y <= 3.6e+59) && (y <= 4e+116)))
		tmp = Float64(x + y);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * (-1.0 - (x / y));
	tmp = 0.0;
	if (y <= -1.2e+71)
		tmp = t_0;
	elseif (y <= -1e-71)
		tmp = x + y;
	elseif (y <= -1.35e-210)
		tmp = x / (1.0 - (y / z));
	elseif ((y <= 1350.0) || (~((y <= 3.6e+59)) && (y <= 4e+116)))
		tmp = x + y;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2e+71], t$95$0, If[LessEqual[y, -1e-71], N[(x + y), $MachinePrecision], If[LessEqual[y, -1.35e-210], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1350.0], And[N[Not[LessEqual[y, 3.6e+59]], $MachinePrecision], LessEqual[y, 4e+116]]], N[(x + y), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1 \cdot 10^{-71}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq -1.35 \cdot 10^{-210}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\

\mathbf{elif}\;y \leq 1350 \lor \neg \left(y \leq 3.6 \cdot 10^{+59}\right) \land y \leq 4 \cdot 10^{+116}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.1999999999999999e71 or 1350 < y < 3.5999999999999999e59 or 4.00000000000000006e116 < y

    1. Initial program 78.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \frac{y + x}{-y}} \]
    6. Taylor expanded in z around 0 58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1999999999999999e71 < y < -9.9999999999999992e-72 or -1.34999999999999996e-210 < y < 1350 or 3.5999999999999999e59 < y < 4.00000000000000006e116

    1. Initial program 99.2%

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

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

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

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

    if -9.9999999999999992e-72 < y < -1.34999999999999996e-210

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+71}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-71}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{-210}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 1350 \lor \neg \left(y \leq 3.6 \cdot 10^{+59}\right) \land y \leq 4 \cdot 10^{+116}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.2% accurate, 0.2× 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 -6.4 \cdot 10^{+93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-42}:\\ \;\;\;\;\frac{y}{t\_0}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-211}:\\ \;\;\;\;\frac{x}{t\_0}\\ \mathbf{elif}\;y \leq 36000 \lor \neg \left(y \leq 1.5 \cdot 10^{+59}\right) \land y \leq 4.2 \cdot 10^{+116}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 -6.4e+93)
     t_1
     (if (<= y -7.5e-42)
       (/ y t_0)
       (if (<= y -3.5e-211)
         (/ x t_0)
         (if (or (<= y 36000.0) (and (not (<= y 1.5e+59)) (<= y 4.2e+116)))
           (+ x y)
           t_1))))))
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 <= -6.4e+93) {
		tmp = t_1;
	} else if (y <= -7.5e-42) {
		tmp = y / t_0;
	} else if (y <= -3.5e-211) {
		tmp = x / t_0;
	} else if ((y <= 36000.0) || (!(y <= 1.5e+59) && (y <= 4.2e+116))) {
		tmp = x + 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 = z * ((-1.0d0) - (x / y))
    if (y <= (-6.4d+93)) then
        tmp = t_1
    else if (y <= (-7.5d-42)) then
        tmp = y / t_0
    else if (y <= (-3.5d-211)) then
        tmp = x / t_0
    else if ((y <= 36000.0d0) .or. (.not. (y <= 1.5d+59)) .and. (y <= 4.2d+116)) then
        tmp = x + 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 = z * (-1.0 - (x / y));
	double tmp;
	if (y <= -6.4e+93) {
		tmp = t_1;
	} else if (y <= -7.5e-42) {
		tmp = y / t_0;
	} else if (y <= -3.5e-211) {
		tmp = x / t_0;
	} else if ((y <= 36000.0) || (!(y <= 1.5e+59) && (y <= 4.2e+116))) {
		tmp = x + y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	t_1 = z * (-1.0 - (x / y))
	tmp = 0
	if y <= -6.4e+93:
		tmp = t_1
	elif y <= -7.5e-42:
		tmp = y / t_0
	elif y <= -3.5e-211:
		tmp = x / t_0
	elif (y <= 36000.0) or (not (y <= 1.5e+59) and (y <= 4.2e+116)):
		tmp = x + y
	else:
		tmp = t_1
	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 <= -6.4e+93)
		tmp = t_1;
	elseif (y <= -7.5e-42)
		tmp = Float64(y / t_0);
	elseif (y <= -3.5e-211)
		tmp = Float64(x / t_0);
	elseif ((y <= 36000.0) || (!(y <= 1.5e+59) && (y <= 4.2e+116)))
		tmp = Float64(x + y);
	else
		tmp = t_1;
	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 <= -6.4e+93)
		tmp = t_1;
	elseif (y <= -7.5e-42)
		tmp = y / t_0;
	elseif (y <= -3.5e-211)
		tmp = x / t_0;
	elseif ((y <= 36000.0) || (~((y <= 1.5e+59)) && (y <= 4.2e+116)))
		tmp = x + 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[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.4e+93], t$95$1, If[LessEqual[y, -7.5e-42], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -3.5e-211], N[(x / t$95$0), $MachinePrecision], If[Or[LessEqual[y, 36000.0], And[N[Not[LessEqual[y, 1.5e+59]], $MachinePrecision], LessEqual[y, 4.2e+116]]], N[(x + y), $MachinePrecision], t$95$1]]]]]]
\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 -6.4 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -7.5 \cdot 10^{-42}:\\
\;\;\;\;\frac{y}{t\_0}\\

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

\mathbf{elif}\;y \leq 36000 \lor \neg \left(y \leq 1.5 \cdot 10^{+59}\right) \land y \leq 4.2 \cdot 10^{+116}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.4000000000000003e93 or 36000 < y < 1.5e59 or 4.2000000000000002e116 < y

    1. Initial program 77.4%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \frac{y + x}{-y}} \]
    6. Taylor expanded in z around 0 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(-1 + \color{blue}{\left(-\frac{x}{y}\right)}\right) \]
      19. 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 -6.4000000000000003e93 < y < -7.49999999999999972e-42

    1. Initial program 97.5%

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

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

    if -7.49999999999999972e-42 < y < -3.5e-211

    1. Initial program 99.9%

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

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

    if -3.5e-211 < y < 36000 or 1.5e59 < y < 4.2000000000000002e116

    1. Initial program 98.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.4 \cdot 10^{+93}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-42}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-211}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 36000 \lor \neg \left(y \leq 1.5 \cdot 10^{+59}\right) \land y \leq 4.2 \cdot 10^{+116}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ \mathbf{if}\;y \leq -5.8 \cdot 10^{+93}:\\ \;\;\;\;z \cdot \frac{x + y}{-y}\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-41}:\\ \;\;\;\;\frac{y}{t\_0}\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{-212}:\\ \;\;\;\;\frac{x}{t\_0}\\ \mathbf{elif}\;y \leq 225 \lor \neg \left(y \leq 2.5 \cdot 10^{+56}\right) \land y \leq 8 \cdot 10^{+120}:\\ \;\;\;\;x + y\\ \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))))
   (if (<= y -5.8e+93)
     (* z (/ (+ x y) (- y)))
     (if (<= y -1.8e-41)
       (/ y t_0)
       (if (<= y -3.1e-212)
         (/ x t_0)
         (if (or (<= y 225.0) (and (not (<= y 2.5e+56)) (<= y 8e+120)))
           (+ x y)
           (* z (- -1.0 (/ x y)))))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double tmp;
	if (y <= -5.8e+93) {
		tmp = z * ((x + y) / -y);
	} else if (y <= -1.8e-41) {
		tmp = y / t_0;
	} else if (y <= -3.1e-212) {
		tmp = x / t_0;
	} else if ((y <= 225.0) || (!(y <= 2.5e+56) && (y <= 8e+120))) {
		tmp = x + y;
	} 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 = 1.0d0 - (y / z)
    if (y <= (-5.8d+93)) then
        tmp = z * ((x + y) / -y)
    else if (y <= (-1.8d-41)) then
        tmp = y / t_0
    else if (y <= (-3.1d-212)) then
        tmp = x / t_0
    else if ((y <= 225.0d0) .or. (.not. (y <= 2.5d+56)) .and. (y <= 8d+120)) then
        tmp = x + y
    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 tmp;
	if (y <= -5.8e+93) {
		tmp = z * ((x + y) / -y);
	} else if (y <= -1.8e-41) {
		tmp = y / t_0;
	} else if (y <= -3.1e-212) {
		tmp = x / t_0;
	} else if ((y <= 225.0) || (!(y <= 2.5e+56) && (y <= 8e+120))) {
		tmp = x + y;
	} else {
		tmp = z * (-1.0 - (x / y));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	tmp = 0
	if y <= -5.8e+93:
		tmp = z * ((x + y) / -y)
	elif y <= -1.8e-41:
		tmp = y / t_0
	elif y <= -3.1e-212:
		tmp = x / t_0
	elif (y <= 225.0) or (not (y <= 2.5e+56) and (y <= 8e+120)):
		tmp = x + y
	else:
		tmp = z * (-1.0 - (x / y))
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	tmp = 0.0
	if (y <= -5.8e+93)
		tmp = Float64(z * Float64(Float64(x + y) / Float64(-y)));
	elseif (y <= -1.8e-41)
		tmp = Float64(y / t_0);
	elseif (y <= -3.1e-212)
		tmp = Float64(x / t_0);
	elseif ((y <= 225.0) || (!(y <= 2.5e+56) && (y <= 8e+120)))
		tmp = Float64(x + y);
	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);
	tmp = 0.0;
	if (y <= -5.8e+93)
		tmp = z * ((x + y) / -y);
	elseif (y <= -1.8e-41)
		tmp = y / t_0;
	elseif (y <= -3.1e-212)
		tmp = x / t_0;
	elseif ((y <= 225.0) || (~((y <= 2.5e+56)) && (y <= 8e+120)))
		tmp = x + y;
	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]}, If[LessEqual[y, -5.8e+93], N[(z * N[(N[(x + y), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.8e-41], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -3.1e-212], N[(x / t$95$0), $MachinePrecision], If[Or[LessEqual[y, 225.0], And[N[Not[LessEqual[y, 2.5e+56]], $MachinePrecision], LessEqual[y, 8e+120]]], N[(x + y), $MachinePrecision], N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.8 \cdot 10^{-41}:\\
\;\;\;\;\frac{y}{t\_0}\\

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

\mathbf{elif}\;y \leq 225 \lor \neg \left(y \leq 2.5 \cdot 10^{+56}\right) \land y \leq 8 \cdot 10^{+120}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -5.7999999999999997e93

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

    if -5.7999999999999997e93 < y < -1.8e-41

    1. Initial program 97.5%

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

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

    if -1.8e-41 < y < -3.10000000000000006e-212

    1. Initial program 99.9%

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

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

    if -3.10000000000000006e-212 < y < 225 or 2.50000000000000012e56 < y < 7.9999999999999998e120

    1. Initial program 98.9%

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

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

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

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

    if 225 < y < 2.50000000000000012e56 or 7.9999999999999998e120 < y

    1. Initial program 73.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \frac{y + x}{-y}} \]
    6. Taylor expanded in z around 0 60.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+93}:\\ \;\;\;\;z \cdot \frac{x + y}{-y}\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-41}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -3.1 \cdot 10^{-212}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 225 \lor \neg \left(y \leq 2.5 \cdot 10^{+56}\right) \land y \leq 8 \cdot 10^{+120}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 73.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+71} \lor \neg \left(y \leq 15500\right) \land \left(y \leq 3.6 \cdot 10^{+58} \lor \neg \left(y \leq 2.9 \cdot 10^{+119}\right)\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 -7.2e+71)
         (and (not (<= y 15500.0)) (or (<= y 3.6e+58) (not (<= y 2.9e+119)))))
   (* z (- -1.0 (/ x y)))
   (+ x y)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -7.2e+71) || (!(y <= 15500.0) && ((y <= 3.6e+58) || !(y <= 2.9e+119)))) {
		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 <= (-7.2d+71)) .or. (.not. (y <= 15500.0d0)) .and. (y <= 3.6d+58) .or. (.not. (y <= 2.9d+119))) 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 <= -7.2e+71) || (!(y <= 15500.0) && ((y <= 3.6e+58) || !(y <= 2.9e+119)))) {
		tmp = z * (-1.0 - (x / y));
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -7.2e+71) or (not (y <= 15500.0) and ((y <= 3.6e+58) or not (y <= 2.9e+119))):
		tmp = z * (-1.0 - (x / y))
	else:
		tmp = x + y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -7.2e+71) || (!(y <= 15500.0) && ((y <= 3.6e+58) || !(y <= 2.9e+119))))
		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 <= -7.2e+71) || (~((y <= 15500.0)) && ((y <= 3.6e+58) || ~((y <= 2.9e+119)))))
		tmp = z * (-1.0 - (x / y));
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -7.2e+71], And[N[Not[LessEqual[y, 15500.0]], $MachinePrecision], Or[LessEqual[y, 3.6e+58], N[Not[LessEqual[y, 2.9e+119]], $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 -7.2 \cdot 10^{+71} \lor \neg \left(y \leq 15500\right) \land \left(y \leq 3.6 \cdot 10^{+58} \lor \neg \left(y \leq 2.9 \cdot 10^{+119}\right)\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 < -7.1999999999999999e71 or 15500 < y < 3.59999999999999996e58 or 2.90000000000000007e119 < y

    1. Initial program 78.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \frac{y + x}{-y}} \]
    6. Taylor expanded in z around 0 58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.1999999999999999e71 < y < 15500 or 3.59999999999999996e58 < y < 2.90000000000000007e119

    1. Initial program 99.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+71} \lor \neg \left(y \leq 15500\right) \land \left(y \leq 3.6 \cdot 10^{+58} \lor \neg \left(y \leq 2.9 \cdot 10^{+119}\right)\right):\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 58.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq -1.75 \cdot 10^{-40}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 10000:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.99999999999999997e67 or 1e4 < y

    1. Initial program 80.3%

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

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

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

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

    if -1.99999999999999997e67 < y < -1.7500000000000001e-40

    1. Initial program 99.8%

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

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

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

    if -1.7500000000000001e-40 < y < 1e4

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+67}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-40}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 10000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 67.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+74} \lor \neg \left(y \leq 5.8 \cdot 10^{+139}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.6000000000000001e74 or 5.7999999999999998e139 < y

    1. Initial program 76.1%

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

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

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

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

    if -2.6000000000000001e74 < y < 5.7999999999999998e139

    1. Initial program 98.3%

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

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

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

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

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

Alternative 8: 41.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq 2.3 \cdot 10^{-68}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.30000000000000019e-134 or 2.29999999999999997e-68 < x

    1. Initial program 90.2%

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

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

    if -3.30000000000000019e-134 < x < 2.29999999999999997e-68

    1. Initial program 92.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.3 \cdot 10^{-134}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-68}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 34.8% 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 91.1%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification36.5%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 93.9% 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 2024067 
(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))))