Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B

Percentage Accurate: 75.2% → 87.7%
Time: 15.9s
Alternatives: 12
Speedup: 0.6×

Specification

?
\[\begin{array}{l} \\ \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b):
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b)
	return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 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: 75.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (/ (+ x (/ (* y z) t)) (+ (+ a 1.0) (/ (* y b) t))))
double code(double x, double y, double z, double t, double a, double b) {
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
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)) / ((a + 1.0d0) + ((y * b) / t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
}
def code(x, y, z, t, a, b):
	return (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t))
function code(x, y, z, t, a, b)
	return Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(a + 1.0) + Float64(Float64(y * b) / t)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = (x + ((y * z) / t)) / ((a + 1.0) + ((y * b) / t));
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 87.7% accurate, 0.0× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := \frac{x + \frac{y \cdot z}{t}}{t\_1 + \left(a + 1\right)}\\
t_3 := 1 + \left(a + t\_1\right)\\
t_4 := 1 + \mathsf{fma}\left(b, \frac{y}{t}, a\right)\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-286}:\\
\;\;\;\;\frac{x}{t\_3} + \frac{y \cdot z}{t \cdot t\_3}\\

\mathbf{elif}\;t\_2 \leq 0 \lor \neg \left(t\_2 \leq \infty\right):\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, \frac{z}{t\_4}, \frac{x}{t\_4}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.00000000000000037e-286

    1. Initial program 85.0%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative85.0%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define89.0%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified85.6%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 91.7%

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

    if -5.00000000000000037e-286 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or +inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 30.6%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative30.6%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define32.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 32.8%

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} + \frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} \]
    6. Step-by-step derivation
      1. +-commutative32.8%

        \[\leadsto \color{blue}{\frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)} + \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
      2. times-frac25.9%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}} + \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} \]
      3. fma-define25.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
      4. associate-*r/32.1%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
      7. associate-*r/36.8%

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

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

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

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

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

    if 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < +inf.0

    1. Initial program 85.6%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative85.6%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define85.6%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified80.9%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 88.1%

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} + \frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} \]
    6. Step-by-step derivation
      1. +-commutative88.1%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
      4. associate-*r/92.4%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
      7. associate-*r/92.4%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \mathsf{fma}\left(b, \frac{y}{t}, a\right)}, \frac{x}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}\right) \]
    7. Simplified92.4%

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

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

Alternative 2: 87.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x + \frac{y \cdot z}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{y \cdot z}{y \cdot b + t \cdot \left(a + 1\right)}\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-286} \lor \neg \left(t\_1 \leq 0\right) \land t\_1 \leq 4 \cdot 10^{+280}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (+ x (/ (* y z) t)) (+ (/ (* y b) t) (+ a 1.0)))))
   (if (<= t_1 (- INFINITY))
     (/ (* y z) (+ (* y b) (* t (+ a 1.0))))
     (if (or (<= t_1 -5e-286) (and (not (<= t_1 0.0)) (<= t_1 4e+280)))
       t_1
       (/ (+ z (/ (* x t) y)) b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
	} else if ((t_1 <= -5e-286) || (!(t_1 <= 0.0) && (t_1 <= 4e+280))) {
		tmp = t_1;
	} else {
		tmp = (z + ((x * t) / y)) / b;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
	} else if ((t_1 <= -5e-286) || (!(t_1 <= 0.0) && (t_1 <= 4e+280))) {
		tmp = t_1;
	} else {
		tmp = (z + ((x * t) / y)) / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = (y * z) / ((y * b) + (t * (a + 1.0)))
	elif (t_1 <= -5e-286) or (not (t_1 <= 0.0) and (t_1 <= 4e+280)):
		tmp = t_1
	else:
		tmp = (z + ((x * t) / y)) / b
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(Float64(y * z) / Float64(Float64(y * b) + Float64(t * Float64(a + 1.0))));
	elseif ((t_1 <= -5e-286) || (!(t_1 <= 0.0) && (t_1 <= 4e+280)))
		tmp = t_1;
	else
		tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (x + ((y * z) / t)) / (((y * b) / t) + (a + 1.0));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = (y * z) / ((y * b) + (t * (a + 1.0)));
	elseif ((t_1 <= -5e-286) || (~((t_1 <= 0.0)) && (t_1 <= 4e+280)))
		tmp = t_1;
	else
		tmp = (z + ((x * t) / y)) / b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * z), $MachinePrecision] / N[(N[(y * b), $MachinePrecision] + N[(t * N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -5e-286], And[N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision], LessEqual[t$95$1, 4e+280]]], t$95$1, N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-286} \lor \neg \left(t\_1 \leq 0\right) \land t\_1 \leq 4 \cdot 10^{+280}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\


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

    1. Initial program 30.2%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative30.2%

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

        \[\leadsto \frac{x + \color{blue}{z \cdot \frac{y}{t}}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    4. Applied egg-rr55.0%

      \[\leadsto \frac{x + \color{blue}{z \cdot \frac{y}{t}}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    5. Taylor expanded in t around 0 55.0%

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{b \cdot y + t \cdot \left(1 + a\right)}} \]

    if -inf.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.00000000000000037e-286 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.0000000000000001e280

    1. Initial program 98.7%

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

    if -5.00000000000000037e-286 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 4.0000000000000001e280 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 28.6%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative28.6%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define36.4%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified42.9%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 32.9%

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} + \frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} \]
    6. Step-by-step derivation
      1. +-commutative32.9%

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

        \[\leadsto \color{blue}{\frac{y}{t} \cdot \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}} + \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} \]
      3. fma-define36.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
      4. associate-*r/39.8%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
      7. associate-*r/43.7%

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

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

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

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

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

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

Alternative 3: 86.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot b}{t}\\ t_2 := 1 + \left(a + t\_1\right)\\ t_3 := \frac{x + \frac{y \cdot z}{t}}{t\_1 + \left(a + 1\right)}\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{-286} \lor \neg \left(t\_3 \leq 0\right) \land t\_3 \leq 4 \cdot 10^{+280}:\\ \;\;\;\;\frac{x}{t\_2} + \frac{y \cdot z}{t \cdot t\_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (/ (* y b) t))
        (t_2 (+ 1.0 (+ a t_1)))
        (t_3 (/ (+ x (/ (* y z) t)) (+ t_1 (+ a 1.0)))))
   (if (or (<= t_3 -5e-286) (and (not (<= t_3 0.0)) (<= t_3 4e+280)))
     (+ (/ x t_2) (/ (* y z) (* t t_2)))
     (/ (+ z (/ (* x t) y)) b))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (y * b) / t;
	double t_2 = 1.0 + (a + t_1);
	double t_3 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
	double tmp;
	if ((t_3 <= -5e-286) || (!(t_3 <= 0.0) && (t_3 <= 4e+280))) {
		tmp = (x / t_2) + ((y * z) / (t * t_2));
	} else {
		tmp = (z + ((x * t) / y)) / 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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (y * b) / t
    t_2 = 1.0d0 + (a + t_1)
    t_3 = (x + ((y * z) / t)) / (t_1 + (a + 1.0d0))
    if ((t_3 <= (-5d-286)) .or. (.not. (t_3 <= 0.0d0)) .and. (t_3 <= 4d+280)) then
        tmp = (x / t_2) + ((y * z) / (t * t_2))
    else
        tmp = (z + ((x * t) / y)) / 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 = (y * b) / t;
	double t_2 = 1.0 + (a + t_1);
	double t_3 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
	double tmp;
	if ((t_3 <= -5e-286) || (!(t_3 <= 0.0) && (t_3 <= 4e+280))) {
		tmp = (x / t_2) + ((y * z) / (t * t_2));
	} else {
		tmp = (z + ((x * t) / y)) / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (y * b) / t
	t_2 = 1.0 + (a + t_1)
	t_3 = (x + ((y * z) / t)) / (t_1 + (a + 1.0))
	tmp = 0
	if (t_3 <= -5e-286) or (not (t_3 <= 0.0) and (t_3 <= 4e+280)):
		tmp = (x / t_2) + ((y * z) / (t * t_2))
	else:
		tmp = (z + ((x * t) / y)) / b
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(y * b) / t)
	t_2 = Float64(1.0 + Float64(a + t_1))
	t_3 = Float64(Float64(x + Float64(Float64(y * z) / t)) / Float64(t_1 + Float64(a + 1.0)))
	tmp = 0.0
	if ((t_3 <= -5e-286) || (!(t_3 <= 0.0) && (t_3 <= 4e+280)))
		tmp = Float64(Float64(x / t_2) + Float64(Float64(y * z) / Float64(t * t_2)));
	else
		tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (y * b) / t;
	t_2 = 1.0 + (a + t_1);
	t_3 = (x + ((y * z) / t)) / (t_1 + (a + 1.0));
	tmp = 0.0;
	if ((t_3 <= -5e-286) || (~((t_3 <= 0.0)) && (t_3 <= 4e+280)))
		tmp = (x / t_2) + ((y * z) / (t * t_2));
	else
		tmp = (z + ((x * t) / y)) / b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$3, -5e-286], And[N[Not[LessEqual[t$95$3, 0.0]], $MachinePrecision], LessEqual[t$95$3, 4e+280]]], N[(N[(x / t$95$2), $MachinePrecision] + N[(N[(y * z), $MachinePrecision] / N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot b}{t}\\
t_2 := 1 + \left(a + t\_1\right)\\
t_3 := \frac{x + \frac{y \cdot z}{t}}{t\_1 + \left(a + 1\right)}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-286} \lor \neg \left(t\_3 \leq 0\right) \land t\_3 \leq 4 \cdot 10^{+280}:\\
\;\;\;\;\frac{x}{t\_2} + \frac{y \cdot z}{t \cdot t\_2}\\

\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < -5.00000000000000037e-286 or 0.0 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 4.0000000000000001e280

    1. Initial program 90.0%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative90.0%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified85.6%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 94.2%

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

    if -5.00000000000000037e-286 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t))) < 0.0 or 4.0000000000000001e280 < (/.f64 (+.f64 x (/.f64 (*.f64 y z) t)) (+.f64 (+.f64 a #s(literal 1 binary64)) (/.f64 (*.f64 y b) t)))

    1. Initial program 28.6%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative28.6%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define36.4%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified42.9%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 32.9%

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} + \frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} \]
    6. Step-by-step derivation
      1. +-commutative32.9%

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

        \[\leadsto \color{blue}{\frac{y}{t} \cdot \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}} + \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} \]
      3. fma-define36.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
      4. associate-*r/39.8%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
      7. associate-*r/43.7%

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

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

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

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

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

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

Alternative 4: 81.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.55 \cdot 10^{+207}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-17}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+184}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -2.55e+207)
   (/ (+ z (/ (* x t) y)) b)
   (if (<= y -2e-17)
     (/ (+ x (* y (/ z t))) (+ (+ a 1.0) (* y (/ b t))))
     (if (<= y 6.8e+184)
       (/ (+ x (* z (/ y t))) (+ (/ (* y b) t) (+ a 1.0)))
       (/ z b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -2.55e+207) {
		tmp = (z + ((x * t) / y)) / b;
	} else if (y <= -2e-17) {
		tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
	} else if (y <= 6.8e+184) {
		tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0));
	} 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 <= (-2.55d+207)) then
        tmp = (z + ((x * t) / y)) / b
    else if (y <= (-2d-17)) then
        tmp = (x + (y * (z / t))) / ((a + 1.0d0) + (y * (b / t)))
    else if (y <= 6.8d+184) then
        tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0d0))
    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 <= -2.55e+207) {
		tmp = (z + ((x * t) / y)) / b;
	} else if (y <= -2e-17) {
		tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
	} else if (y <= 6.8e+184) {
		tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0));
	} else {
		tmp = z / b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -2.55e+207:
		tmp = (z + ((x * t) / y)) / b
	elif y <= -2e-17:
		tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)))
	elif y <= 6.8e+184:
		tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0))
	else:
		tmp = z / b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -2.55e+207)
		tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b);
	elseif (y <= -2e-17)
		tmp = Float64(Float64(x + Float64(y * Float64(z / t))) / Float64(Float64(a + 1.0) + Float64(y * Float64(b / t))));
	elseif (y <= 6.8e+184)
		tmp = Float64(Float64(x + Float64(z * Float64(y / t))) / Float64(Float64(Float64(y * b) / t) + Float64(a + 1.0)));
	else
		tmp = Float64(z / b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -2.55e+207)
		tmp = (z + ((x * t) / y)) / b;
	elseif (y <= -2e-17)
		tmp = (x + (y * (z / t))) / ((a + 1.0) + (y * (b / t)));
	elseif (y <= 6.8e+184)
		tmp = (x + (z * (y / t))) / (((y * b) / t) + (a + 1.0));
	else
		tmp = z / b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.55e+207], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, -2e-17], N[(N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a + 1.0), $MachinePrecision] + N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+184], N[(N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision] + N[(a + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / b), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.55 \cdot 10^{+207}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\

\mathbf{elif}\;y \leq -2 \cdot 10^{-17}:\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\

\mathbf{elif}\;y \leq 6.8 \cdot 10^{+184}:\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.5499999999999999e207

    1. Initial program 24.9%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative24.9%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified47.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 25.0%

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} + \frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} \]
    6. Step-by-step derivation
      1. +-commutative25.0%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
      4. associate-*r/28.3%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
      7. associate-*r/28.3%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \mathsf{fma}\left(b, \frac{y}{t}, a\right)}, \frac{x}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}\right) \]
    7. Simplified28.3%

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

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

    if -2.5499999999999999e207 < y < -2.00000000000000014e-17

    1. Initial program 67.2%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. associate-/l*71.4%

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

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

      \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}} \]
    4. Add Preprocessing

    if -2.00000000000000014e-17 < y < 6.8000000000000003e184

    1. Initial program 86.8%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative86.8%

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

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

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

    if 6.8000000000000003e184 < y

    1. Initial program 34.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative34.1%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified41.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 79.0%

      \[\leadsto \color{blue}{\frac{z}{b}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.55 \cdot 10^{+207}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-17}:\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+184}:\\ \;\;\;\;\frac{x + z \cdot \frac{y}{t}}{\frac{y \cdot b}{t} + \left(a + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 81.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-73} \lor \neg \left(t \leq 2.5 \cdot 10^{-200}\right):\\
\;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\

\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.2000000000000002e-73 or 2.49999999999999996e-200 < t

    1. Initial program 79.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. associate-/l*83.8%

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

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

      \[\leadsto \color{blue}{\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}} \]
    4. Add Preprocessing

    if -5.2000000000000002e-73 < t < 2.49999999999999996e-200

    1. Initial program 51.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative51.1%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define46.0%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified38.6%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 62.0%

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} + \frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} \]
    6. Step-by-step derivation
      1. +-commutative62.0%

        \[\leadsto \color{blue}{\frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)} + \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
      2. times-frac51.3%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
      4. associate-*r/46.4%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
      7. associate-*r/46.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{-73} \lor \neg \left(t \leq 2.5 \cdot 10^{-200}\right):\\ \;\;\;\;\frac{x + y \cdot \frac{z}{t}}{\left(a + 1\right) + y \cdot \frac{b}{t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 69.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -500000000000 \lor \neg \left(t \leq 4.4 \cdot 10^{-98}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t}}{a + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5e11 or 4.39999999999999993e-98 < t

    1. Initial program 80.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative80.1%

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

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

      \[\leadsto \frac{x + \color{blue}{z \cdot \frac{y}{t}}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    5. Taylor expanded in y around 0 78.7%

      \[\leadsto \frac{x + z \cdot \frac{y}{t}}{\color{blue}{1 + a}} \]

    if -5e11 < t < 4.39999999999999993e-98

    1. Initial program 61.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative61.1%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define57.2%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified51.9%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 70.2%

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} + \frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} \]
    6. Step-by-step derivation
      1. +-commutative70.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
      4. associate-*r/53.6%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
      7. associate-*r/53.6%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \mathsf{fma}\left(b, \frac{y}{t}, a\right)}, \frac{x}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}\right) \]
    7. Simplified53.6%

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

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

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

Alternative 7: 64.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -31000000000000 \lor \neg \left(t \leq 8.5 \cdot 10^{-56}\right):\\
\;\;\;\;\frac{x}{1 + \left(a + \frac{y \cdot b}{t}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.1e13 or 8.49999999999999932e-56 < t

    1. Initial program 80.5%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative80.5%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define88.4%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified92.0%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 69.0%

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]

    if -3.1e13 < t < 8.49999999999999932e-56

    1. Initial program 62.5%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative62.5%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified51.9%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 71.5%

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} + \frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} \]
    6. Step-by-step derivation
      1. +-commutative71.5%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
      4. associate-*r/56.5%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
      7. associate-*r/56.5%

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

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

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

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

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

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

Alternative 8: 60.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -9000000000:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-47}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a + 1}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -9000000000.0)
   (/ x (+ a 1.0))
   (if (<= t 1.75e-47) (/ (+ z (/ (* x t) y)) b) (/ 1.0 (/ (+ a 1.0) x)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -9000000000.0) {
		tmp = x / (a + 1.0);
	} else if (t <= 1.75e-47) {
		tmp = (z + ((x * t) / y)) / b;
	} else {
		tmp = 1.0 / ((a + 1.0) / x);
	}
	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 (t <= (-9000000000.0d0)) then
        tmp = x / (a + 1.0d0)
    else if (t <= 1.75d-47) then
        tmp = (z + ((x * t) / y)) / b
    else
        tmp = 1.0d0 / ((a + 1.0d0) / x)
    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 (t <= -9000000000.0) {
		tmp = x / (a + 1.0);
	} else if (t <= 1.75e-47) {
		tmp = (z + ((x * t) / y)) / b;
	} else {
		tmp = 1.0 / ((a + 1.0) / x);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -9000000000.0:
		tmp = x / (a + 1.0)
	elif t <= 1.75e-47:
		tmp = (z + ((x * t) / y)) / b
	else:
		tmp = 1.0 / ((a + 1.0) / x)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -9000000000.0)
		tmp = Float64(x / Float64(a + 1.0));
	elseif (t <= 1.75e-47)
		tmp = Float64(Float64(z + Float64(Float64(x * t) / y)) / b);
	else
		tmp = Float64(1.0 / Float64(Float64(a + 1.0) / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -9000000000.0)
		tmp = x / (a + 1.0);
	elseif (t <= 1.75e-47)
		tmp = (z + ((x * t) / y)) / b;
	else
		tmp = 1.0 / ((a + 1.0) / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9000000000.0], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e-47], N[(N[(z + N[(N[(x * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9000000000:\\
\;\;\;\;\frac{x}{a + 1}\\

\mathbf{elif}\;t \leq 1.75 \cdot 10^{-47}:\\
\;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a + 1}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9e9

    1. Initial program 80.5%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative80.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 62.3%

      \[\leadsto \color{blue}{\frac{x}{1 + a}} \]

    if -9e9 < t < 1.7499999999999999e-47

    1. Initial program 63.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative63.1%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define58.9%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified52.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 72.0%

      \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} + \frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} \]
    6. Step-by-step derivation
      1. +-commutative72.0%

        \[\leadsto \color{blue}{\frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)} + \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
      2. times-frac62.4%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}} + \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} \]
      3. fma-define62.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
      4. associate-*r/57.2%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
      7. associate-*r/57.2%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \mathsf{fma}\left(b, \frac{y}{t}, a\right)}, \frac{x}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}\right) \]
    7. Simplified57.2%

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

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

    if 1.7499999999999999e-47 < t

    1. Initial program 80.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative80.1%

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

        \[\leadsto \frac{x + \color{blue}{z \cdot \frac{y}{t}}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    4. Applied egg-rr90.0%

      \[\leadsto \frac{x + \color{blue}{z \cdot \frac{y}{t}}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    5. Step-by-step derivation
      1. clear-num89.8%

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

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

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

        \[\leadsto {\left(\frac{\left(1 + a\right) + \frac{\color{blue}{b \cdot y}}{t}}{x + z \cdot \frac{y}{t}}\right)}^{-1} \]
      5. associate-*r/92.4%

        \[\leadsto {\left(\frac{\left(1 + a\right) + \color{blue}{b \cdot \frac{y}{t}}}{x + z \cdot \frac{y}{t}}\right)}^{-1} \]
      6. associate-+r+92.4%

        \[\leadsto {\left(\frac{\color{blue}{1 + \left(a + b \cdot \frac{y}{t}\right)}}{x + z \cdot \frac{y}{t}}\right)}^{-1} \]
      7. +-commutative92.4%

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

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

        \[\leadsto {\left(\frac{1 + \left(\frac{\color{blue}{y \cdot b}}{t} + a\right)}{x + z \cdot \frac{y}{t}}\right)}^{-1} \]
      10. associate-/l*91.1%

        \[\leadsto {\left(\frac{1 + \left(\color{blue}{y \cdot \frac{b}{t}} + a\right)}{x + z \cdot \frac{y}{t}}\right)}^{-1} \]
      11. fma-define91.1%

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

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

        \[\leadsto {\left(\frac{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}{\color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}}\right)}^{-1} \]
    6. Applied egg-rr91.1%

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1 + a}{x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9000000000:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-47}:\\ \;\;\;\;\frac{z + \frac{x \cdot t}{y}}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a + 1}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 56.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -29000000000000:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-49}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a + 1}{x}}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -29000000000000.0)
   (/ x (+ a 1.0))
   (if (<= t 4e-49) (/ z b) (/ 1.0 (/ (+ a 1.0) x)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -29000000000000.0) {
		tmp = x / (a + 1.0);
	} else if (t <= 4e-49) {
		tmp = z / b;
	} else {
		tmp = 1.0 / ((a + 1.0) / x);
	}
	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 (t <= (-29000000000000.0d0)) then
        tmp = x / (a + 1.0d0)
    else if (t <= 4d-49) then
        tmp = z / b
    else
        tmp = 1.0d0 / ((a + 1.0d0) / x)
    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 (t <= -29000000000000.0) {
		tmp = x / (a + 1.0);
	} else if (t <= 4e-49) {
		tmp = z / b;
	} else {
		tmp = 1.0 / ((a + 1.0) / x);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -29000000000000.0:
		tmp = x / (a + 1.0)
	elif t <= 4e-49:
		tmp = z / b
	else:
		tmp = 1.0 / ((a + 1.0) / x)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -29000000000000.0)
		tmp = Float64(x / Float64(a + 1.0));
	elseif (t <= 4e-49)
		tmp = Float64(z / b);
	else
		tmp = Float64(1.0 / Float64(Float64(a + 1.0) / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -29000000000000.0)
		tmp = x / (a + 1.0);
	elseif (t <= 4e-49)
		tmp = z / b;
	else
		tmp = 1.0 / ((a + 1.0) / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -29000000000000.0], N[(x / N[(a + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-49], N[(z / b), $MachinePrecision], N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -29000000000000:\\
\;\;\;\;\frac{x}{a + 1}\\

\mathbf{elif}\;t \leq 4 \cdot 10^{-49}:\\
\;\;\;\;\frac{z}{b}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a + 1}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.9e13

    1. Initial program 80.5%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative80.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 62.3%

      \[\leadsto \color{blue}{\frac{x}{1 + a}} \]

    if -2.9e13 < t < 3.99999999999999975e-49

    1. Initial program 63.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative63.1%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define58.9%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified52.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 57.4%

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

    if 3.99999999999999975e-49 < t

    1. Initial program 80.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative80.1%

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

        \[\leadsto \frac{x + \color{blue}{z \cdot \frac{y}{t}}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    4. Applied egg-rr90.0%

      \[\leadsto \frac{x + \color{blue}{z \cdot \frac{y}{t}}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    5. Step-by-step derivation
      1. clear-num89.8%

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

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

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

        \[\leadsto {\left(\frac{\left(1 + a\right) + \frac{\color{blue}{b \cdot y}}{t}}{x + z \cdot \frac{y}{t}}\right)}^{-1} \]
      5. associate-*r/92.4%

        \[\leadsto {\left(\frac{\left(1 + a\right) + \color{blue}{b \cdot \frac{y}{t}}}{x + z \cdot \frac{y}{t}}\right)}^{-1} \]
      6. associate-+r+92.4%

        \[\leadsto {\left(\frac{\color{blue}{1 + \left(a + b \cdot \frac{y}{t}\right)}}{x + z \cdot \frac{y}{t}}\right)}^{-1} \]
      7. +-commutative92.4%

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

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

        \[\leadsto {\left(\frac{1 + \left(\frac{\color{blue}{y \cdot b}}{t} + a\right)}{x + z \cdot \frac{y}{t}}\right)}^{-1} \]
      10. associate-/l*91.1%

        \[\leadsto {\left(\frac{1 + \left(\color{blue}{y \cdot \frac{b}{t}} + a\right)}{x + z \cdot \frac{y}{t}}\right)}^{-1} \]
      11. fma-define91.1%

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

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

        \[\leadsto {\left(\frac{1 + \mathsf{fma}\left(y, \frac{b}{t}, a\right)}{\color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)}}\right)}^{-1} \]
    6. Applied egg-rr91.1%

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1 + a}{x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -29000000000000:\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-49}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a + 1}{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 56.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -210000000000 \lor \neg \left(t \leq 9 \cdot 10^{-49}\right):\\
\;\;\;\;\frac{x}{a + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.1e11 or 9.0000000000000004e-49 < t

    1. Initial program 80.2%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative80.2%

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified91.9%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 64.0%

      \[\leadsto \color{blue}{\frac{x}{1 + a}} \]

    if -2.1e11 < t < 9.0000000000000004e-49

    1. Initial program 63.1%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative63.1%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define58.9%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified52.7%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 57.4%

      \[\leadsto \color{blue}{\frac{z}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -210000000000 \lor \neg \left(t \leq 9 \cdot 10^{-49}\right):\\ \;\;\;\;\frac{x}{a + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 43.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -48000000000 \lor \neg \left(t \leq 2.9 \cdot 10^{+23}\right):\\
\;\;\;\;\frac{x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.8e10 or 2.90000000000000013e23 < t

    1. Initial program 79.7%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative79.7%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define88.6%

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\color{blue}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    3. Simplified93.4%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 79.7%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
      4. associate-*r/92.7%

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
      7. associate-*r/95.1%

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(\frac{\frac{x}{z}}{1 + \left(a + b \cdot \frac{y}{t}\right)} + \frac{\frac{y}{t}}{1 + \left(a + \color{blue}{b \cdot \frac{y}{t}}\right)}\right) \]
    10. Simplified80.7%

      \[\leadsto \color{blue}{z \cdot \left(\frac{\frac{x}{z}}{1 + \left(a + b \cdot \frac{y}{t}\right)} + \frac{\frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\right)} \]
    11. Taylor expanded in a around inf 35.3%

      \[\leadsto z \cdot \color{blue}{\frac{\frac{x}{z} + \frac{y}{t}}{a}} \]
    12. Taylor expanded in z around 0 35.5%

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

    if -4.8e10 < t < 2.90000000000000013e23

    1. Initial program 65.2%

      \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    2. Step-by-step derivation
      1. +-commutative65.2%

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

        \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
      3. fma-define61.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 55.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -48000000000 \lor \neg \left(t \leq 2.9 \cdot 10^{+23}\right):\\ \;\;\;\;\frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 26.3% accurate, 5.7× speedup?

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

\\
\frac{x}{a}
\end{array}
Derivation
  1. Initial program 72.0%

    \[\frac{x + \frac{y \cdot z}{t}}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
  2. Step-by-step derivation
    1. +-commutative72.0%

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

      \[\leadsto \frac{\color{blue}{y \cdot \frac{z}{t}} + x}{\left(a + 1\right) + \frac{y \cdot b}{t}} \]
    3. fma-define74.2%

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

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

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

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

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(y, \frac{z}{t}, x\right)}{\mathsf{fma}\left(y, \frac{b}{t}, a + 1\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in z around 0 76.3%

    \[\leadsto \color{blue}{\frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)} + \frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)}} \]
  6. Step-by-step derivation
    1. +-commutative76.3%

      \[\leadsto \color{blue}{\frac{y \cdot z}{t \cdot \left(1 + \left(a + \frac{b \cdot y}{t}\right)\right)} + \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}} \]
    2. times-frac76.3%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \left(a + \frac{b \cdot y}{t}\right)}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right)} \]
    4. associate-*r/75.3%

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

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

      \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}, \frac{x}{1 + \left(a + \frac{b \cdot y}{t}\right)}\right) \]
    7. associate-*r/76.4%

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

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

      \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \frac{z}{1 + \mathsf{fma}\left(b, \frac{y}{t}, a\right)}, \frac{x}{1 + \color{blue}{\mathsf{fma}\left(b, \frac{y}{t}, a\right)}}\right) \]
  7. Simplified76.4%

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

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

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

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

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

      \[\leadsto z \cdot \left(\frac{\frac{x}{z}}{1 + \left(a + b \cdot \frac{y}{t}\right)} + \frac{\frac{y}{t}}{1 + \left(a + \color{blue}{b \cdot \frac{y}{t}}\right)}\right) \]
  10. Simplified67.3%

    \[\leadsto \color{blue}{z \cdot \left(\frac{\frac{x}{z}}{1 + \left(a + b \cdot \frac{y}{t}\right)} + \frac{\frac{y}{t}}{1 + \left(a + b \cdot \frac{y}{t}\right)}\right)} \]
  11. Taylor expanded in a around inf 26.0%

    \[\leadsto z \cdot \color{blue}{\frac{\frac{x}{z} + \frac{y}{t}}{a}} \]
  12. Taylor expanded in z around 0 22.8%

    \[\leadsto \color{blue}{\frac{x}{a}} \]
  13. Add Preprocessing

Developer Target 1: 79.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 1 \cdot \left(\left(x + \frac{y}{t} \cdot z\right) \cdot \frac{1}{\left(a + 1\right) + \frac{y}{t} \cdot b}\right)\\ \mathbf{if}\;t < -1.3659085366310088 \cdot 10^{-271}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\ \;\;\;\;\frac{z}{b}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1
         (* 1.0 (* (+ x (* (/ y t) z)) (/ 1.0 (+ (+ a 1.0) (* (/ y t) b)))))))
   (if (< t -1.3659085366310088e-271)
     t_1
     (if (< t 3.036967103737246e-130) (/ z b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
	double tmp;
	if (t < -1.3659085366310088e-271) {
		tmp = t_1;
	} else if (t < 3.036967103737246e-130) {
		tmp = z / b;
	} 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 = 1.0d0 * ((x + ((y / t) * z)) * (1.0d0 / ((a + 1.0d0) + ((y / t) * b))))
    if (t < (-1.3659085366310088d-271)) then
        tmp = t_1
    else if (t < 3.036967103737246d-130) then
        tmp = z / b
    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 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
	double tmp;
	if (t < -1.3659085366310088e-271) {
		tmp = t_1;
	} else if (t < 3.036967103737246e-130) {
		tmp = z / b;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))))
	tmp = 0
	if t < -1.3659085366310088e-271:
		tmp = t_1
	elif t < 3.036967103737246e-130:
		tmp = z / b
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(1.0 * Float64(Float64(x + Float64(Float64(y / t) * z)) * Float64(1.0 / Float64(Float64(a + 1.0) + Float64(Float64(y / t) * b)))))
	tmp = 0.0
	if (t < -1.3659085366310088e-271)
		tmp = t_1;
	elseif (t < 3.036967103737246e-130)
		tmp = Float64(z / b);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = 1.0 * ((x + ((y / t) * z)) * (1.0 / ((a + 1.0) + ((y / t) * b))));
	tmp = 0.0;
	if (t < -1.3659085366310088e-271)
		tmp = t_1;
	elseif (t < 3.036967103737246e-130)
		tmp = z / b;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * N[(N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(a + 1.0), $MachinePrecision] + N[(N[(y / t), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.3659085366310088e-271], t$95$1, If[Less[t, 3.036967103737246e-130], N[(z / b), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;t < 3.036967103737246 \cdot 10^{-130}:\\
\;\;\;\;\frac{z}{b}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024167 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, B"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< t -1707385670788761/12500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))) (if (< t 1518483551868623/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ z b) (* 1 (* (+ x (* (/ y t) z)) (/ 1 (+ (+ a 1) (* (/ y t) b))))))))

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