AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1

Percentage Accurate: 61.0% → 89.2%
Time: 12.0s
Alternatives: 12
Speedup: 1.4×

Specification

?
\[\begin{array}{l} \\ \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b):
	return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

\[\begin{array}{l} \\ \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b):
	return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 89.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\ t_2 := \left(x + y\right) \cdot \left(x + y\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, \frac{y}{\left(-y\right) - x}, \mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t\_2}, \frac{a}{x + y}\right) - \mathsf{fma}\left(a, \frac{y}{t\_2}, \frac{z}{x + y}\right), \mathsf{fma}\left(a, \frac{y}{x + y}, z\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) (+ y (+ x t))))
        (t_2 (* (+ x y) (+ x y))))
   (if (<= t_1 (- INFINITY))
     (fma (- z b) (/ y (+ y t)) a)
     (if (<= t_1 5e+278)
       t_1
       (fma
        b
        (/ y (- (- y) x))
        (fma
         t
         (- (fma y (/ b t_2) (/ a (+ x y))) (fma a (/ y t_2) (/ z (+ x y))))
         (fma a (/ y (+ x y)) z)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
	double t_2 = (x + y) * (x + y);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = fma((z - b), (y / (y + t)), a);
	} else if (t_1 <= 5e+278) {
		tmp = t_1;
	} else {
		tmp = fma(b, (y / (-y - x)), fma(t, (fma(y, (b / t_2), (a / (x + y))) - fma(a, (y / t_2), (z / (x + y)))), fma(a, (y / (x + y)), z)));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t)))
	t_2 = Float64(Float64(x + y) * Float64(x + y))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = fma(Float64(z - b), Float64(y / Float64(y + t)), a);
	elseif (t_1 <= 5e+278)
		tmp = t_1;
	else
		tmp = fma(b, Float64(y / Float64(Float64(-y) - x)), fma(t, Float64(fma(y, Float64(b / t_2), Float64(a / Float64(x + y))) - fma(a, Float64(y / t_2), Float64(z / Float64(x + y)))), fma(a, Float64(y / Float64(x + y)), z)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z - b), $MachinePrecision] * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$1, 5e+278], t$95$1, N[(b * N[(y / N[((-y) - x), $MachinePrecision]), $MachinePrecision] + N[(t * N[(N[(y * N[(b / t$95$2), $MachinePrecision] + N[(a / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(y / t$95$2), $MachinePrecision] + N[(z / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := \left(x + y\right) \cdot \left(x + y\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, \frac{y}{\left(-y\right) - x}, \mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{t\_2}, \frac{a}{x + y}\right) - \mathsf{fma}\left(a, \frac{y}{t\_2}, \frac{z}{x + y}\right), \mathsf{fma}\left(a, \frac{y}{x + y}, z\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0

    1. Initial program 6.3%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{b \cdot y}{t + \left(x + y\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right)} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto a \cdot \frac{t + y}{t + \left(x + y\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, \frac{t + y}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\frac{t + y}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{\color{blue}{t + y}}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      9. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{\color{blue}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      11. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      12. div-subN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
    5. Simplified41.7%

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

      \[\leadsto \color{blue}{a + \frac{y \cdot \left(z - b\right)}{t + y}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t + y} + a} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{z - b}{t + y}} + a \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{z - b}{t + y}}, a\right) \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z - b}}{t + y}, a\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
      7. lower-+.f6476.9

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
    8. Simplified76.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)} \]
    9. Taylor expanded in a around 0

      \[\leadsto \color{blue}{a + \frac{y \cdot \left(z - b\right)}{t + y}} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t + y} + a} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(z - b\right) \cdot y}}{t + y} + a \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{\left(z - b\right) \cdot \frac{y}{t + y}} + a \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z - b, \frac{y}{t + y}, a\right)} \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z - b}, \frac{y}{t + y}, a\right) \]
      6. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(z - b, \color{blue}{\frac{y}{t + y}}, a\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z - b, \frac{y}{\color{blue}{y + t}}, a\right) \]
      8. lower-+.f6480.4

        \[\leadsto \mathsf{fma}\left(z - b, \frac{y}{\color{blue}{y + t}}, a\right) \]
    11. Simplified80.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)} \]

    if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000029e278

    1. Initial program 99.6%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing

    if 5.00000000000000029e278 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 4.5%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) - \frac{b \cdot y}{x + y}} \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \color{blue}{\left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{x + y}\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{x + y}\right)\right) + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right)} \]
      3. associate-/l*N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{b \cdot \frac{y}{x + y}}\right)\right) + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{b \cdot \left(\mathsf{neg}\left(\frac{y}{x + y}\right)\right)} + \left(z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, \mathsf{neg}\left(\frac{y}{x + y}\right), z + \left(t \cdot \left(\left(\frac{a}{x + y} + \frac{b \cdot y}{{\left(x + y\right)}^{2}}\right) - \left(\frac{z}{x + y} + \frac{a \cdot y}{{\left(x + y\right)}^{2}}\right)\right) + \frac{a \cdot y}{x + y}\right)\right)} \]
    5. Simplified83.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, -\frac{y}{y + x}, \mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{\left(y + x\right) \cdot \left(y + x\right)}, \frac{a}{y + x}\right) - \mathsf{fma}\left(a, \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}, \frac{z}{y + x}\right), \mathsf{fma}\left(a, \frac{y}{y + x}, z\right)\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)} \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\ \mathbf{elif}\;\frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)} \leq 5 \cdot 10^{+278}:\\ \;\;\;\;\frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, \frac{y}{\left(-y\right) - x}, \mathsf{fma}\left(t, \mathsf{fma}\left(y, \frac{b}{\left(x + y\right) \cdot \left(x + y\right)}, \frac{a}{x + y}\right) - \mathsf{fma}\left(a, \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}, \frac{z}{x + y}\right), \mathsf{fma}\left(a, \frac{y}{x + y}, z\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 90.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+271}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, \frac{y + t}{t + \left(x + y\right)}, z - b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) (+ y (+ x t)))))
   (if (<= t_1 (- INFINITY))
     (fma (- z b) (/ y (+ y t)) a)
     (if (<= t_1 1e+271) t_1 (fma a (/ (+ y t) (+ t (+ x y))) (- z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = fma((z - b), (y / (y + t)), a);
	} else if (t_1 <= 1e+271) {
		tmp = t_1;
	} else {
		tmp = fma(a, ((y + t) / (t + (x + y))), (z - b));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = fma(Float64(z - b), Float64(y / Float64(y + t)), a);
	elseif (t_1 <= 1e+271)
		tmp = t_1;
	else
		tmp = fma(a, Float64(Float64(y + t) / Float64(t + Float64(x + y))), Float64(z - b));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(z - b), $MachinePrecision] * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t$95$1, 1e+271], t$95$1, N[(a * N[(N[(y + t), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+271}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \frac{y + t}{t + \left(x + y\right)}, z - b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0

    1. Initial program 6.3%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{b \cdot y}{t + \left(x + y\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right)} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto a \cdot \frac{t + y}{t + \left(x + y\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, \frac{t + y}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\frac{t + y}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{\color{blue}{t + y}}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      9. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{\color{blue}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      11. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      12. div-subN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
    5. Simplified41.7%

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

      \[\leadsto \color{blue}{a + \frac{y \cdot \left(z - b\right)}{t + y}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t + y} + a} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{z - b}{t + y}} + a \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{z - b}{t + y}}, a\right) \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z - b}}{t + y}, a\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
      7. lower-+.f6476.9

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
    8. Simplified76.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)} \]
    9. Taylor expanded in a around 0

      \[\leadsto \color{blue}{a + \frac{y \cdot \left(z - b\right)}{t + y}} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t + y} + a} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(z - b\right) \cdot y}}{t + y} + a \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{\left(z - b\right) \cdot \frac{y}{t + y}} + a \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z - b, \frac{y}{t + y}, a\right)} \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z - b}, \frac{y}{t + y}, a\right) \]
      6. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(z - b, \color{blue}{\frac{y}{t + y}}, a\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z - b, \frac{y}{\color{blue}{y + t}}, a\right) \]
      8. lower-+.f6480.4

        \[\leadsto \mathsf{fma}\left(z - b, \frac{y}{\color{blue}{y + t}}, a\right) \]
    11. Simplified80.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)} \]

    if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999953e270

    1. Initial program 99.6%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing

    if 9.99999999999999953e270 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 6.5%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{b \cdot y}{t + \left(x + y\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right)} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto a \cdot \frac{t + y}{t + \left(x + y\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, \frac{t + y}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\frac{t + y}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{\color{blue}{t + y}}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      9. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{\color{blue}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      11. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      12. div-subN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
      13. lower-/.f64N/A

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

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

      \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{z - b}\right) \]
    7. Step-by-step derivation
      1. lower--.f6481.5

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{z - b}\right) \]
    8. Simplified81.5%

      \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{z - b}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)} \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\ \mathbf{elif}\;\frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)} \leq 10^{+271}:\\ \;\;\;\;\frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, \frac{y + t}{t + \left(x + y\right)}, z - b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 53.6% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+80}:\\
\;\;\;\;a - \frac{y \cdot b}{t}\\

\mathbf{else}:\\
\;\;\;\;a + \left(z - b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.0000000000000001e108

    1. Initial program 31.9%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      3. lower--.f6464.3

        \[\leadsto a + \color{blue}{\left(z - b\right)} \]
    5. Simplified64.3%

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{a + z} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{z + a} \]
      2. lower-+.f6465.3

        \[\leadsto \color{blue}{z + a} \]
    8. Simplified65.3%

      \[\leadsto \color{blue}{z + a} \]

    if -4.0000000000000001e108 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.99999999999999961e80

    1. Initial program 99.6%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around -inf

      \[\leadsto \color{blue}{a + -1 \cdot \frac{-1 \cdot \left(\left(a \cdot y + z \cdot \left(x + y\right)\right) - b \cdot y\right) - -1 \cdot \left(a \cdot \left(x + y\right)\right)}{t}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto a + \color{blue}{\left(\mathsf{neg}\left(\frac{-1 \cdot \left(\left(a \cdot y + z \cdot \left(x + y\right)\right) - b \cdot y\right) - -1 \cdot \left(a \cdot \left(x + y\right)\right)}{t}\right)\right)} \]
      2. unsub-negN/A

        \[\leadsto \color{blue}{a - \frac{-1 \cdot \left(\left(a \cdot y + z \cdot \left(x + y\right)\right) - b \cdot y\right) - -1 \cdot \left(a \cdot \left(x + y\right)\right)}{t}} \]
      3. lower--.f64N/A

        \[\leadsto \color{blue}{a - \frac{-1 \cdot \left(\left(a \cdot y + z \cdot \left(x + y\right)\right) - b \cdot y\right) - -1 \cdot \left(a \cdot \left(x + y\right)\right)}{t}} \]
      4. lower-/.f64N/A

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

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

      \[\leadsto a - \frac{\color{blue}{b \cdot y}}{t} \]
    7. Step-by-step derivation
      1. lower-*.f6443.0

        \[\leadsto a - \frac{\color{blue}{b \cdot y}}{t} \]
    8. Simplified43.0%

      \[\leadsto a - \frac{\color{blue}{b \cdot y}}{t} \]

    if 4.99999999999999961e80 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y))

    1. Initial program 36.7%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      3. lower--.f6468.1

        \[\leadsto a + \color{blue}{\left(z - b\right)} \]
    5. Simplified68.1%

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification56.3%

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

Alternative 4: 76.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, \frac{a}{x} - \frac{b}{x}, z\right)\\ \mathbf{if}\;x \leq -2.15 \cdot 10^{+98}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+148}:\\ \;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (fma y (- (/ a x) (/ b x)) z)))
   (if (<= x -2.15e+98)
     t_1
     (if (<= x 4.2e+148) (fma (- z b) (/ y (+ y t)) a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fma(y, ((a / x) - (b / x)), z);
	double tmp;
	if (x <= -2.15e+98) {
		tmp = t_1;
	} else if (x <= 4.2e+148) {
		tmp = fma((z - b), (y / (y + t)), a);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = fma(y, Float64(Float64(a / x) - Float64(b / x)), z)
	tmp = 0.0
	if (x <= -2.15e+98)
		tmp = t_1;
	elseif (x <= 4.2e+148)
		tmp = fma(Float64(z - b), Float64(y / Float64(y + t)), a);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]}, If[LessEqual[x, -2.15e+98], t$95$1, If[LessEqual[x, 4.2e+148], N[(N[(z - b), $MachinePrecision] * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{a}{x} - \frac{b}{x}, z\right)\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 4.2 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1500000000000001e98 or 4.19999999999999998e148 < x

    1. Initial program 56.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{\frac{\left(a \cdot y + z \cdot \left(x + y\right)\right) - b \cdot y}{x + y}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(a \cdot y + z \cdot \left(x + y\right)\right) - b \cdot y}{x + y}} \]
      2. associate--l+N/A

        \[\leadsto \frac{\color{blue}{a \cdot y + \left(z \cdot \left(x + y\right) - b \cdot y\right)}}{x + y} \]
      3. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(a, y, z \cdot \left(x + y\right) - b \cdot y\right)}}{x + y} \]
      4. distribute-rgt-inN/A

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \color{blue}{\left(x \cdot z + y \cdot z\right)} - b \cdot y\right)}{x + y} \]
      5. associate--l+N/A

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \color{blue}{x \cdot z + \left(y \cdot z - b \cdot y\right)}\right)}{x + y} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \color{blue}{z \cdot x} + \left(y \cdot z - b \cdot y\right)\right)}{x + y} \]
      7. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \color{blue}{\mathsf{fma}\left(z, x, y \cdot z - b \cdot y\right)}\right)}{x + y} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, y \cdot z - \color{blue}{y \cdot b}\right)\right)}{x + y} \]
      9. distribute-lft-out--N/A

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, \color{blue}{y \cdot \left(z - b\right)}\right)\right)}{x + y} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, \color{blue}{y \cdot \left(z - b\right)}\right)\right)}{x + y} \]
      11. lower--.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, y \cdot \color{blue}{\left(z - b\right)}\right)\right)}{x + y} \]
      12. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, y \cdot \left(z - b\right)\right)\right)}{\color{blue}{y + x}} \]
      13. lower-+.f6446.1

        \[\leadsto \frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, y \cdot \left(z - b\right)\right)\right)}{\color{blue}{y + x}} \]
    5. Simplified46.1%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, y, \mathsf{fma}\left(z, x, y \cdot \left(z - b\right)\right)\right)}{y + x}} \]
    6. Taylor expanded in y around 0

      \[\leadsto \color{blue}{z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{y \cdot \left(\frac{a}{x} - \frac{b}{x}\right) + z} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{a}{x} - \frac{b}{x}, z\right)} \]
      3. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{a}{x} - \frac{b}{x}}, z\right) \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{a}{x}} - \frac{b}{x}, z\right) \]
      5. lower-/.f6472.0

        \[\leadsto \mathsf{fma}\left(y, \frac{a}{x} - \color{blue}{\frac{b}{x}}, z\right) \]
    8. Simplified72.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{a}{x} - \frac{b}{x}, z\right)} \]

    if -2.1500000000000001e98 < x < 4.19999999999999998e148

    1. Initial program 65.7%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{b \cdot y}{t + \left(x + y\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right)} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto a \cdot \frac{t + y}{t + \left(x + y\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, \frac{t + y}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\frac{t + y}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{\color{blue}{t + y}}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      9. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{\color{blue}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      11. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      12. div-subN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
    5. Simplified79.5%

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

      \[\leadsto \color{blue}{a + \frac{y \cdot \left(z - b\right)}{t + y}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t + y} + a} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{z - b}{t + y}} + a \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{z - b}{t + y}}, a\right) \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z - b}}{t + y}, a\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
      7. lower-+.f6481.0

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
    8. Simplified81.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)} \]
    9. Taylor expanded in a around 0

      \[\leadsto \color{blue}{a + \frac{y \cdot \left(z - b\right)}{t + y}} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t + y} + a} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(z - b\right) \cdot y}}{t + y} + a \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{\left(z - b\right) \cdot \frac{y}{t + y}} + a \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z - b, \frac{y}{t + y}, a\right)} \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z - b}, \frac{y}{t + y}, a\right) \]
      6. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(z - b, \color{blue}{\frac{y}{t + y}}, a\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z - b, \frac{y}{\color{blue}{y + t}}, a\right) \]
      8. lower-+.f6483.6

        \[\leadsto \mathsf{fma}\left(z - b, \frac{y}{\color{blue}{y + t}}, a\right) \]
    11. Simplified83.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 72.7% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{+193}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 7 \cdot 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -2.1e+193) z (if (<= x 7e+157) (fma (- z b) (/ y (+ y t)) a) z)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -2.1e+193) {
		tmp = z;
	} else if (x <= 7e+157) {
		tmp = fma((z - b), (y / (y + t)), a);
	} else {
		tmp = z;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -2.1e+193)
		tmp = z;
	elseif (x <= 7e+157)
		tmp = fma(Float64(z - b), Float64(y / Float64(y + t)), a);
	else
		tmp = z;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.1e+193], z, If[LessEqual[x, 7e+157], N[(N[(z - b), $MachinePrecision] * N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], z]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 7 \cdot 10^{+157}:\\
\;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1e193 or 7.00000000000000004e157 < x

    1. Initial program 55.6%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)} \]
      2. lower-neg.f64N/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right) \]
      4. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)}\right)\right) \]
      5. unsub-negN/A

        \[\leadsto \mathsf{neg}\left(z \cdot \color{blue}{\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} - \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right) \]
      6. lower--.f64N/A

        \[\leadsto \mathsf{neg}\left(z \cdot \color{blue}{\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} - \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right) \]
    5. Simplified73.7%

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

      \[\leadsto \mathsf{neg}\left(\color{blue}{-1 \cdot z}\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right) \]
      2. lower-neg.f6454.0

        \[\leadsto -\color{blue}{\left(-z\right)} \]
    8. Simplified54.0%

      \[\leadsto -\color{blue}{\left(-z\right)} \]

    if -2.1e193 < x < 7.00000000000000004e157

    1. Initial program 65.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{b \cdot y}{t + \left(x + y\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right)} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto a \cdot \frac{t + y}{t + \left(x + y\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, \frac{t + y}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\frac{t + y}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{\color{blue}{t + y}}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      9. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{\color{blue}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      11. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      12. div-subN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
      13. lower-/.f64N/A

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

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

      \[\leadsto \color{blue}{a + \frac{y \cdot \left(z - b\right)}{t + y}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t + y} + a} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{z - b}{t + y}} + a \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{z - b}{t + y}}, a\right) \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z - b}}{t + y}, a\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
      7. lower-+.f6478.1

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
    8. Simplified78.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)} \]
    9. Taylor expanded in a around 0

      \[\leadsto \color{blue}{a + \frac{y \cdot \left(z - b\right)}{t + y}} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t + y} + a} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(z - b\right) \cdot y}}{t + y} + a \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{\left(z - b\right) \cdot \frac{y}{t + y}} + a \]
      4. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z - b, \frac{y}{t + y}, a\right)} \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z - b}, \frac{y}{t + y}, a\right) \]
      6. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(z - b, \color{blue}{\frac{y}{t + y}}, a\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z - b, \frac{y}{\color{blue}{y + t}}, a\right) \]
      8. lower-+.f6480.4

        \[\leadsto \mathsf{fma}\left(z - b, \frac{y}{\color{blue}{y + t}}, a\right) \]
    11. Simplified80.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{+193}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 7 \cdot 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(z - b, \frac{y}{y + t}, a\right)\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 70.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{+193}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -2.1e+193) z (if (<= x 6.8e+157) (fma y (/ (- z b) (+ y t)) a) z)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -2.1e+193) {
		tmp = z;
	} else if (x <= 6.8e+157) {
		tmp = fma(y, ((z - b) / (y + t)), a);
	} else {
		tmp = z;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -2.1e+193)
		tmp = z;
	elseif (x <= 6.8e+157)
		tmp = fma(y, Float64(Float64(z - b) / Float64(y + t)), a);
	else
		tmp = z;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.1e+193], z, If[LessEqual[x, 6.8e+157], N[(y * N[(N[(z - b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], z]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 6.8 \cdot 10^{+157}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1e193 or 6.79999999999999958e157 < x

    1. Initial program 55.6%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in z around -inf

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)} \]
      2. lower-neg.f64N/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + -1 \cdot \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right) \]
      4. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(z \cdot \left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} + \color{blue}{\left(\mathsf{neg}\left(\frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)\right)}\right)\right) \]
      5. unsub-negN/A

        \[\leadsto \mathsf{neg}\left(z \cdot \color{blue}{\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} - \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right) \]
      6. lower--.f64N/A

        \[\leadsto \mathsf{neg}\left(z \cdot \color{blue}{\left(-1 \cdot \frac{x + y}{t + \left(x + y\right)} - \frac{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}}{z}\right)}\right) \]
    5. Simplified73.7%

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

      \[\leadsto \mathsf{neg}\left(\color{blue}{-1 \cdot z}\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right) \]
      2. lower-neg.f6454.0

        \[\leadsto -\color{blue}{\left(-z\right)} \]
    8. Simplified54.0%

      \[\leadsto -\color{blue}{\left(-z\right)} \]

    if -2.1e193 < x < 6.79999999999999958e157

    1. Initial program 65.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{b \cdot y}{t + \left(x + y\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right)} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto a \cdot \frac{t + y}{t + \left(x + y\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, \frac{t + y}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\frac{t + y}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{\color{blue}{t + y}}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      9. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{\color{blue}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      11. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      12. div-subN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
      13. lower-/.f64N/A

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

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

      \[\leadsto \color{blue}{a + \frac{y \cdot \left(z - b\right)}{t + y}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t + y} + a} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{z - b}{t + y}} + a \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{z - b}{t + y}}, a\right) \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z - b}}{t + y}, a\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
      7. lower-+.f6478.1

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
    8. Simplified78.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{+193}:\\ \;\;\;\;z\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 62.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, \frac{z - b}{t}, a\right)\\ \mathbf{if}\;t \leq -2.5 \cdot 10^{+115}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+99}:\\ \;\;\;\;a + \left(z - b\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (fma y (/ (- z b) t) a)))
   (if (<= t -2.5e+115) t_1 (if (<= t 6.5e+99) (+ a (- z b)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fma(y, ((z - b) / t), a);
	double tmp;
	if (t <= -2.5e+115) {
		tmp = t_1;
	} else if (t <= 6.5e+99) {
		tmp = a + (z - b);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = fma(y, Float64(Float64(z - b) / t), a)
	tmp = 0.0
	if (t <= -2.5e+115)
		tmp = t_1;
	elseif (t <= 6.5e+99)
		tmp = Float64(a + Float64(z - b));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(N[(z - b), $MachinePrecision] / t), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[t, -2.5e+115], t$95$1, If[LessEqual[t, 6.5e+99], N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{z - b}{t}, a\right)\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 6.5 \cdot 10^{+99}:\\
\;\;\;\;a + \left(z - b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.50000000000000004e115 or 6.5000000000000004e99 < t

    1. Initial program 56.1%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{b \cdot y}{t + \left(x + y\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} + \left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)}\right) + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)} \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\frac{a \cdot \left(t + y\right)}{t + \left(x + y\right)} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right)} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{a \cdot \frac{t + y}{t + \left(x + y\right)}} + \left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} + \left(\mathsf{neg}\left(\frac{b \cdot y}{t + \left(x + y\right)}\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto a \cdot \frac{t + y}{t + \left(x + y\right)} + \color{blue}{\left(\frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, \frac{t + y}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right)} \]
      7. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \color{blue}{\frac{t + y}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      8. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{\color{blue}{t + y}}{t + \left(x + y\right)}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      9. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{\color{blue}{t + \left(x + y\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      11. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \color{blue}{\left(y + x\right)}}, \frac{z \cdot \left(x + y\right)}{t + \left(x + y\right)} - \frac{b \cdot y}{t + \left(x + y\right)}\right) \]
      12. div-subN/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
      13. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \frac{t + y}{t + \left(y + x\right)}, \color{blue}{\frac{z \cdot \left(x + y\right) - b \cdot y}{t + \left(x + y\right)}}\right) \]
    5. Simplified81.7%

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

      \[\leadsto \color{blue}{a + \frac{y \cdot \left(z - b\right)}{t + y}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t + y} + a} \]
      2. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{z - b}{t + y}} + a \]
      3. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{t + y}, a\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{z - b}{t + y}}, a\right) \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z - b}}{t + y}, a\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
      7. lower-+.f6481.4

        \[\leadsto \mathsf{fma}\left(y, \frac{z - b}{\color{blue}{y + t}}, a\right) \]
    8. Simplified81.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{y + t}, a\right)} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{a + y \cdot \left(\frac{z}{t} - \frac{b}{t}\right)} \]
    10. Step-by-step derivation
      1. div-subN/A

        \[\leadsto a + y \cdot \color{blue}{\frac{z - b}{t}} \]
      2. associate-/l*N/A

        \[\leadsto a + \color{blue}{\frac{y \cdot \left(z - b\right)}{t}} \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{y \cdot \left(z - b\right)}{t} + a} \]
      4. associate-/l*N/A

        \[\leadsto \color{blue}{y \cdot \frac{z - b}{t}} + a \]
      5. div-subN/A

        \[\leadsto y \cdot \color{blue}{\left(\frac{z}{t} - \frac{b}{t}\right)} + a \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z}{t} - \frac{b}{t}, a\right)} \]
      7. div-subN/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{z - b}{t}}, a\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{z - b}{t}}, a\right) \]
      9. lower--.f6473.5

        \[\leadsto \mathsf{fma}\left(y, \frac{\color{blue}{z - b}}{t}, a\right) \]
    11. Simplified73.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - b}{t}, a\right)} \]

    if -2.50000000000000004e115 < t < 6.5000000000000004e99

    1. Initial program 66.4%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      3. lower--.f6451.3

        \[\leadsto a + \color{blue}{\left(z - b\right)} \]
    5. Simplified51.3%

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 58.6% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
t_1 := a + \left(z - b\right)\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 4.1 \cdot 10^{+14}:\\
\;\;\;\;z + a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.1000000000000002e165 or 4.1e14 < y

    1. Initial program 33.2%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      3. lower--.f6482.0

        \[\leadsto a + \color{blue}{\left(z - b\right)} \]
    5. Simplified82.0%

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]

    if -3.1000000000000002e165 < y < 4.1e14

    1. Initial program 76.5%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      3. lower--.f6430.4

        \[\leadsto a + \color{blue}{\left(z - b\right)} \]
    5. Simplified30.4%

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{a + z} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{z + a} \]
      2. lower-+.f6443.2

        \[\leadsto \color{blue}{z + a} \]
    8. Simplified43.2%

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

Alternative 9: 50.7% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.5 \cdot 10^{+204}:\\ \;\;\;\;z - b\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+84}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;z - b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -1.5e+204) (- z b) (if (<= y 1.85e+84) (+ z a) (- z b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.5e+204) {
		tmp = z - b;
	} else if (y <= 1.85e+84) {
		tmp = z + a;
	} else {
		tmp = z - b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= (-1.5d+204)) then
        tmp = z - b
    else if (y <= 1.85d+84) then
        tmp = z + a
    else
        tmp = z - b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.5e+204) {
		tmp = z - b;
	} else if (y <= 1.85e+84) {
		tmp = z + a;
	} else {
		tmp = z - b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -1.5e+204:
		tmp = z - b
	elif y <= 1.85e+84:
		tmp = z + a
	else:
		tmp = z - b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -1.5e+204)
		tmp = Float64(z - b);
	elseif (y <= 1.85e+84)
		tmp = Float64(z + a);
	else
		tmp = Float64(z - b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -1.5e+204)
		tmp = z - b;
	elseif (y <= 1.85e+84)
		tmp = z + a;
	else
		tmp = z - b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.5e+204], N[(z - b), $MachinePrecision], If[LessEqual[y, 1.85e+84], N[(z + a), $MachinePrecision], N[(z - b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+204}:\\
\;\;\;\;z - b\\

\mathbf{elif}\;y \leq 1.85 \cdot 10^{+84}:\\
\;\;\;\;z + a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.49999999999999991e204 or 1.85e84 < y

    1. Initial program 22.5%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      3. lower--.f6484.0

        \[\leadsto a + \color{blue}{\left(z - b\right)} \]
    5. Simplified84.0%

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
    6. Taylor expanded in a around 0

      \[\leadsto \color{blue}{z - b} \]
    7. Step-by-step derivation
      1. lower--.f6473.1

        \[\leadsto \color{blue}{z - b} \]
    8. Simplified73.1%

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

    if -1.49999999999999991e204 < y < 1.85e84

    1. Initial program 73.6%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      3. lower--.f6436.7

        \[\leadsto a + \color{blue}{\left(z - b\right)} \]
    5. Simplified36.7%

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{a + z} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{z + a} \]
      2. lower-+.f6445.8

        \[\leadsto \color{blue}{z + a} \]
    8. Simplified45.8%

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

Alternative 10: 51.8% accurate, 4.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.9 \cdot 10^{+193}:\\ \;\;\;\;z + a\\ \mathbf{else}:\\ \;\;\;\;a - b\\ \end{array} \end{array} \]
(FPCore (x y z t a b) :precision binary64 (if (<= y 4.9e+193) (+ z a) (- a b)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= 4.9e+193) {
		tmp = z + a;
	} else {
		tmp = a - b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= 4.9d+193) then
        tmp = z + a
    else
        tmp = a - b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= 4.9e+193) {
		tmp = z + a;
	} else {
		tmp = a - b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= 4.9e+193:
		tmp = z + a
	else:
		tmp = a - b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= 4.9e+193)
		tmp = Float64(z + a);
	else
		tmp = Float64(a - b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= 4.9e+193)
		tmp = z + a;
	else
		tmp = a - b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 4.9e+193], N[(z + a), $MachinePrecision], N[(a - b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.9 \cdot 10^{+193}:\\
\;\;\;\;z + a\\

\mathbf{else}:\\
\;\;\;\;a - b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.9000000000000003e193

    1. Initial program 66.7%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      3. lower--.f6443.9

        \[\leadsto a + \color{blue}{\left(z - b\right)} \]
    5. Simplified43.9%

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{a + z} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{z + a} \]
      2. lower-+.f6446.8

        \[\leadsto \color{blue}{z + a} \]
    8. Simplified46.8%

      \[\leadsto \color{blue}{z + a} \]

    if 4.9000000000000003e193 < y

    1. Initial program 14.8%

      \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

      \[\leadsto \color{blue}{\left(a + z\right) - b} \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      2. lower-+.f64N/A

        \[\leadsto \color{blue}{a + \left(z - b\right)} \]
      3. lower--.f6481.0

        \[\leadsto a + \color{blue}{\left(z - b\right)} \]
    5. Simplified81.0%

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
    6. Taylor expanded in z around 0

      \[\leadsto \color{blue}{a - b} \]
    7. Step-by-step derivation
      1. lower--.f6460.5

        \[\leadsto \color{blue}{a - b} \]
    8. Simplified60.5%

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

Alternative 11: 52.3% accurate, 11.3× speedup?

\[\begin{array}{l} \\ z + a \end{array} \]
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
	return z + a;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return z + a;
}
def code(x, y, z, t, a, b):
	return z + a
function code(x, y, z, t, a, b)
	return Float64(z + a)
end
function tmp = code(x, y, z, t, a, b)
	tmp = z + a;
end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}

\\
z + a
\end{array}
Derivation
  1. Initial program 62.8%

    \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf

    \[\leadsto \color{blue}{\left(a + z\right) - b} \]
  4. Step-by-step derivation
    1. associate--l+N/A

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
    2. lower-+.f64N/A

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
    3. lower--.f6446.7

      \[\leadsto a + \color{blue}{\left(z - b\right)} \]
  5. Simplified46.7%

    \[\leadsto \color{blue}{a + \left(z - b\right)} \]
  6. Taylor expanded in b around 0

    \[\leadsto \color{blue}{a + z} \]
  7. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \color{blue}{z + a} \]
    2. lower-+.f6446.0

      \[\leadsto \color{blue}{z + a} \]
  8. Simplified46.0%

    \[\leadsto \color{blue}{z + a} \]
  9. Add Preprocessing

Alternative 12: 12.9% accurate, 15.0× speedup?

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

\\
-b
\end{array}
Derivation
  1. Initial program 62.8%

    \[\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y} \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf

    \[\leadsto \color{blue}{\left(a + z\right) - b} \]
  4. Step-by-step derivation
    1. associate--l+N/A

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
    2. lower-+.f64N/A

      \[\leadsto \color{blue}{a + \left(z - b\right)} \]
    3. lower--.f6446.7

      \[\leadsto a + \color{blue}{\left(z - b\right)} \]
  5. Simplified46.7%

    \[\leadsto \color{blue}{a + \left(z - b\right)} \]
  6. Taylor expanded in b around inf

    \[\leadsto \color{blue}{-1 \cdot b} \]
  7. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \color{blue}{\mathsf{neg}\left(b\right)} \]
    2. lower-neg.f6413.0

      \[\leadsto \color{blue}{-b} \]
  8. Simplified13.0%

    \[\leadsto \color{blue}{-b} \]
  9. Add Preprocessing

Developer Target 1: 82.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x + t\right) + y\\ t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\ t_3 := \frac{t\_2}{t\_1}\\ t_4 := \left(z + a\right) - b\\ \mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\ \;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (+ (+ x t) y))
        (t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
        (t_3 (/ t_2 t_1))
        (t_4 (- (+ z a) b)))
   (if (< t_3 -3.5813117084150564e+153)
     t_4
     (if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + t) + y;
	double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
	double t_3 = t_2 / t_1;
	double t_4 = (z + a) - b;
	double tmp;
	if (t_3 < -3.5813117084150564e+153) {
		tmp = t_4;
	} else if (t_3 < 1.2285964308315609e+82) {
		tmp = 1.0 / (t_1 / t_2);
	} else {
		tmp = t_4;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = (x + t) + y
    t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
    t_3 = t_2 / t_1
    t_4 = (z + a) - b
    if (t_3 < (-3.5813117084150564d+153)) then
        tmp = t_4
    else if (t_3 < 1.2285964308315609d+82) then
        tmp = 1.0d0 / (t_1 / t_2)
    else
        tmp = t_4
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + t) + y;
	double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
	double t_3 = t_2 / t_1;
	double t_4 = (z + a) - b;
	double tmp;
	if (t_3 < -3.5813117084150564e+153) {
		tmp = t_4;
	} else if (t_3 < 1.2285964308315609e+82) {
		tmp = 1.0 / (t_1 / t_2);
	} else {
		tmp = t_4;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (x + t) + y
	t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
	t_3 = t_2 / t_1
	t_4 = (z + a) - b
	tmp = 0
	if t_3 < -3.5813117084150564e+153:
		tmp = t_4
	elif t_3 < 1.2285964308315609e+82:
		tmp = 1.0 / (t_1 / t_2)
	else:
		tmp = t_4
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(x + t) + y)
	t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b))
	t_3 = Float64(t_2 / t_1)
	t_4 = Float64(Float64(z + a) - b)
	tmp = 0.0
	if (t_3 < -3.5813117084150564e+153)
		tmp = t_4;
	elseif (t_3 < 1.2285964308315609e+82)
		tmp = Float64(1.0 / Float64(t_1 / t_2));
	else
		tmp = t_4;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (x + t) + y;
	t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
	t_3 = t_2 / t_1;
	t_4 = (z + a) - b;
	tmp = 0.0;
	if (t_3 < -3.5813117084150564e+153)
		tmp = t_4;
	elseif (t_3 < 1.2285964308315609e+82)
		tmp = 1.0 / (t_1 / t_2);
	else
		tmp = t_4;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024215 
(FPCore (x y z t a b)
  :name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b))))

  (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))