Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B

Percentage Accurate: 96.4% → 96.4%
Time: 16.0s
Alternatives: 20
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\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 20 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: 96.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}

Alternative 1: 96.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Derivation
  1. Initial program 96.1%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 50.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(b, \mathsf{fma}\left(-0.5, b \cdot \left(a \cdot a\right), a\right) \cdot \left(-x\right), x\right)\\

\mathbf{elif}\;t\_2 \leq 5.5 \cdot 10^{+250}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), -t\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3 or 9.99999999999999944e57 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 5.4999999999999999e250

    1. Initial program 98.1%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6444.8

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified44.8%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6421.3

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified21.3%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6421.4

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified21.4%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
    12. Taylor expanded in a around inf

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
    13. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
      2. unpow2N/A

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

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \color{blue}{\left(a \cdot {b}^{2}\right)}\right)\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
      7. *-lowering-*.f6446.7

        \[\leadsto x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
    14. Simplified46.7%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)} \]

    if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.99999999999999944e57

    1. Initial program 94.4%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6484.1

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified84.1%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in b around 0

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

        \[\leadsto \color{blue}{b \cdot \left(-1 \cdot \left(a \cdot x\right) + \frac{1}{2} \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right)\right) + x} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, -1 \cdot \left(a \cdot x\right) + \frac{1}{2} \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right), x\right)} \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right) + -1 \cdot \left(a \cdot x\right)}, x\right) \]
      4. mul-1-negN/A

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

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right) - a \cdot x}, x\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right) - a \cdot x}, x\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot \left(b \cdot x\right)} - a \cdot x, x\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot \left(b \cdot x\right)} - a \cdot x, x\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right)} \cdot \left(b \cdot x\right) - a \cdot x, x\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{fma}\left(b, \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \left(b \cdot x\right) - a \cdot x, x\right) \]
      11. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{fma}\left(b, \left(\frac{1}{2} \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(x \cdot b\right)} - a \cdot x, x\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \left(\frac{1}{2} \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(x \cdot b\right)} - a \cdot x, x\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \left(\frac{1}{2} \cdot \left(a \cdot a\right)\right) \cdot \left(x \cdot b\right) - \color{blue}{x \cdot a}, x\right) \]
      15. *-lowering-*.f6470.2

        \[\leadsto \mathsf{fma}\left(b, \left(0.5 \cdot \left(a \cdot a\right)\right) \cdot \left(x \cdot b\right) - \color{blue}{x \cdot a}, x\right) \]
    8. Simplified70.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, \left(0.5 \cdot \left(a \cdot a\right)\right) \cdot \left(x \cdot b\right) - x \cdot a, x\right)} \]
    9. Taylor expanded in x around -inf

      \[\leadsto \mathsf{fma}\left(b, \color{blue}{-1 \cdot \left(x \cdot \left(\frac{-1}{2} \cdot \left({a}^{2} \cdot b\right) - -1 \cdot a\right)\right)}, x\right) \]
    10. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\mathsf{neg}\left(x \cdot \left(\frac{-1}{2} \cdot \left({a}^{2} \cdot b\right) - -1 \cdot a\right)\right)}, x\right) \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\mathsf{neg}\left(x \cdot \left(\frac{-1}{2} \cdot \left({a}^{2} \cdot b\right) - -1 \cdot a\right)\right)}, x\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \mathsf{neg}\left(\color{blue}{x \cdot \left(\frac{-1}{2} \cdot \left({a}^{2} \cdot b\right) - -1 \cdot a\right)}\right), x\right) \]
      4. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{fma}\left(b, \mathsf{neg}\left(x \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left({a}^{2} \cdot b\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot a\right)}\right), x\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(b, \mathsf{neg}\left(x \cdot \left(\frac{-1}{2} \cdot \left({a}^{2} \cdot b\right) + \color{blue}{1} \cdot a\right)\right), x\right) \]
      6. *-lft-identityN/A

        \[\leadsto \mathsf{fma}\left(b, \mathsf{neg}\left(x \cdot \left(\frac{-1}{2} \cdot \left({a}^{2} \cdot b\right) + \color{blue}{a}\right)\right), x\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \mathsf{neg}\left(x \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, {a}^{2} \cdot b, a\right)}\right), x\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, \mathsf{neg}\left(x \cdot \mathsf{fma}\left(\frac{-1}{2}, \color{blue}{b \cdot {a}^{2}}, a\right)\right), x\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma}\left(b, \mathsf{neg}\left(x \cdot \mathsf{fma}\left(\frac{-1}{2}, \color{blue}{b \cdot {a}^{2}}, a\right)\right), x\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{fma}\left(b, \mathsf{neg}\left(x \cdot \mathsf{fma}\left(\frac{-1}{2}, b \cdot \color{blue}{\left(a \cdot a\right)}, a\right)\right), x\right) \]
      11. *-lowering-*.f6483.7

        \[\leadsto \mathsf{fma}\left(b, -x \cdot \mathsf{fma}\left(-0.5, b \cdot \color{blue}{\left(a \cdot a\right)}, a\right), x\right) \]
    11. Simplified83.7%

      \[\leadsto \mathsf{fma}\left(b, \color{blue}{-x \cdot \mathsf{fma}\left(-0.5, b \cdot \left(a \cdot a\right), a\right)}, x\right) \]

    if 5.4999999999999999e250 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

    1. Initial program 91.8%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(t \cdot y\right)}} \]
      2. *-commutativeN/A

        \[\leadsto x \cdot e^{\mathsf{neg}\left(\color{blue}{y \cdot t}\right)} \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
      5. neg-lowering-neg.f6464.4

        \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-t\right)}} \]
    5. Simplified64.4%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0

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

        \[\leadsto x \cdot \color{blue}{\left(y \cdot \left(-1 \cdot t + \frac{1}{2} \cdot \left({t}^{2} \cdot y\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(y, -1 \cdot t + \frac{1}{2} \cdot \left({t}^{2} \cdot y\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} + \frac{1}{2} \cdot \left({t}^{2} \cdot y\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \color{blue}{\frac{1}{2} \cdot \left({t}^{2} \cdot y\right) + \left(\mathsf{neg}\left(t\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {t}^{2} \cdot y, \mathsf{neg}\left(t\right)\right)}, 1\right) \]
      6. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{y \cdot {t}^{2}}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{y \cdot {t}^{2}}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      8. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, y \cdot \color{blue}{\left(t \cdot t\right)}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, y \cdot \color{blue}{\left(t \cdot t\right)}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      10. neg-lowering-neg.f6468.5

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), \color{blue}{-t}\right), 1\right) \]
    8. Simplified68.5%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), -t\right), 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification58.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2000:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)\\ \mathbf{elif}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 10^{+58}:\\ \;\;\;\;\mathsf{fma}\left(b, \mathsf{fma}\left(-0.5, b \cdot \left(a \cdot a\right), a\right) \cdot \left(-x\right), x\right)\\ \mathbf{elif}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 5.5 \cdot 10^{+250}:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), -t\right), 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 50.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 10^{+58}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), -a\right), 1\right)\\

\mathbf{elif}\;t\_2 \leq 5.5 \cdot 10^{+250}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), -t\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3 or 9.99999999999999944e57 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 5.4999999999999999e250

    1. Initial program 98.1%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6444.8

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified44.8%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6421.3

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified21.3%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6421.4

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified21.4%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
    12. Taylor expanded in a around inf

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
    13. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
      2. unpow2N/A

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

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \color{blue}{\left(a \cdot {b}^{2}\right)}\right)\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
      7. *-lowering-*.f6446.7

        \[\leadsto x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
    14. Simplified46.7%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)} \]

    if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.99999999999999944e57

    1. Initial program 94.4%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6484.1

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified84.1%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in b around 0

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

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

        \[\leadsto x \cdot \left(b \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + -1 \cdot a\right)} + 1\right) \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \left(b \cdot \left(\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right) + 1\right) \]
      4. sub-negN/A

        \[\leadsto x \cdot \left(b \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) - a\right)} + 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(b, \frac{1}{2} \cdot \left({a}^{2} \cdot b\right) - a, 1\right)} \]
      6. sub-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + \left(\mathsf{neg}\left(a\right)\right)}, 1\right) \]
      7. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + \color{blue}{-1 \cdot a}, 1\right) \]
      8. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {a}^{2} \cdot b, -1 \cdot a\right)}, 1\right) \]
      9. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{b \cdot {a}^{2}}, -1 \cdot a\right), 1\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{b \cdot {a}^{2}}, -1 \cdot a\right), 1\right) \]
      11. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, b \cdot \color{blue}{\left(a \cdot a\right)}, -1 \cdot a\right), 1\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, b \cdot \color{blue}{\left(a \cdot a\right)}, -1 \cdot a\right), 1\right) \]
      13. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, b \cdot \left(a \cdot a\right), \color{blue}{\mathsf{neg}\left(a\right)}\right), 1\right) \]
      14. neg-lowering-neg.f6482.4

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), \color{blue}{-a}\right), 1\right) \]
    8. Simplified82.4%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), -a\right), 1\right)} \]

    if 5.4999999999999999e250 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

    1. Initial program 91.8%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(t \cdot y\right)}} \]
      2. *-commutativeN/A

        \[\leadsto x \cdot e^{\mathsf{neg}\left(\color{blue}{y \cdot t}\right)} \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
      5. neg-lowering-neg.f6464.4

        \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-t\right)}} \]
    5. Simplified64.4%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0

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

        \[\leadsto x \cdot \color{blue}{\left(y \cdot \left(-1 \cdot t + \frac{1}{2} \cdot \left({t}^{2} \cdot y\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(y, -1 \cdot t + \frac{1}{2} \cdot \left({t}^{2} \cdot y\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} + \frac{1}{2} \cdot \left({t}^{2} \cdot y\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \color{blue}{\frac{1}{2} \cdot \left({t}^{2} \cdot y\right) + \left(\mathsf{neg}\left(t\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {t}^{2} \cdot y, \mathsf{neg}\left(t\right)\right)}, 1\right) \]
      6. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{y \cdot {t}^{2}}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{y \cdot {t}^{2}}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      8. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, y \cdot \color{blue}{\left(t \cdot t\right)}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, y \cdot \color{blue}{\left(t \cdot t\right)}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      10. neg-lowering-neg.f6468.5

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), \color{blue}{-t}\right), 1\right) \]
    8. Simplified68.5%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), -t\right), 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 42.4% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+194}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), -a\right), 1\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right), 1\right)\\


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

    1. Initial program 98.4%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6453.4

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified53.4%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6432.5

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified32.5%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6432.2

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified32.2%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
    12. Taylor expanded in a around inf

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
    13. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
      2. unpow2N/A

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

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \color{blue}{\left(a \cdot {b}^{2}\right)}\right)\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
      7. *-lowering-*.f6440.0

        \[\leadsto x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
    14. Simplified40.0%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)} \]

    if 0.0 < (*.f64 x (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))))) < 9.99999999999999945e193

    1. Initial program 81.6%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6481.6

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified81.6%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in b around 0

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

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

        \[\leadsto x \cdot \left(b \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + -1 \cdot a\right)} + 1\right) \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \left(b \cdot \left(\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right) + 1\right) \]
      4. sub-negN/A

        \[\leadsto x \cdot \left(b \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) - a\right)} + 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(b, \frac{1}{2} \cdot \left({a}^{2} \cdot b\right) - a, 1\right)} \]
      6. sub-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + \left(\mathsf{neg}\left(a\right)\right)}, 1\right) \]
      7. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + \color{blue}{-1 \cdot a}, 1\right) \]
      8. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {a}^{2} \cdot b, -1 \cdot a\right)}, 1\right) \]
      9. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{b \cdot {a}^{2}}, -1 \cdot a\right), 1\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{b \cdot {a}^{2}}, -1 \cdot a\right), 1\right) \]
      11. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, b \cdot \color{blue}{\left(a \cdot a\right)}, -1 \cdot a\right), 1\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, b \cdot \color{blue}{\left(a \cdot a\right)}, -1 \cdot a\right), 1\right) \]
      13. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, b \cdot \left(a \cdot a\right), \color{blue}{\mathsf{neg}\left(a\right)}\right), 1\right) \]
      14. neg-lowering-neg.f6493.9

        \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), \color{blue}{-a}\right), 1\right) \]
    8. Simplified93.9%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), -a\right), 1\right)} \]

    if 9.99999999999999945e193 < (*.f64 x (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))))

    1. Initial program 92.3%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6453.7

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified53.7%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6455.7

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified55.7%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6455.7

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified55.7%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 42.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\
t_2 := a \cdot \left(b \cdot b\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(a \cdot t\_2\right)\right)\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-67}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(\left(a \cdot a\right) \cdot \left(b \cdot 0.5\right), b, 1\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, t\_2, -b\right), 1\right)\\


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

    1. Initial program 98.4%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6453.4

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified53.4%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6432.5

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified32.5%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6432.2

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified32.2%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
    12. Taylor expanded in a around inf

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
    13. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
      2. unpow2N/A

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

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \color{blue}{\left(a \cdot {b}^{2}\right)}\right)\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
      7. *-lowering-*.f6440.0

        \[\leadsto x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
    14. Simplified40.0%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)} \]

    if 0.0 < (*.f64 x (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))))) < 4.9999999999999999e-67

    1. Initial program 67.3%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6467.3

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified67.3%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6445.8

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified45.8%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6445.8

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified45.8%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
    12. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto x \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot b\right) \cdot b\right)} + 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(a \cdot a\right) \cdot \left(\frac{1}{2} \cdot b\right)\right) \cdot b} + 1\right) \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(\left(a \cdot a\right) \cdot \left(\frac{1}{2} \cdot b\right), b, 1\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(\color{blue}{\left(a \cdot a\right) \cdot \left(\frac{1}{2} \cdot b\right)}, b, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(\color{blue}{\left(a \cdot a\right)} \cdot \left(\frac{1}{2} \cdot b\right), b, 1\right) \]
      7. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(\left(a \cdot a\right) \cdot \color{blue}{\left(b \cdot \frac{1}{2}\right)}, b, 1\right) \]
      8. *-lowering-*.f6497.3

        \[\leadsto x \cdot \mathsf{fma}\left(\left(a \cdot a\right) \cdot \color{blue}{\left(b \cdot 0.5\right)}, b, 1\right) \]
    13. Applied egg-rr97.3%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(\left(a \cdot a\right) \cdot \left(b \cdot 0.5\right), b, 1\right)} \]

    if 4.9999999999999999e-67 < (*.f64 x (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))))

    1. Initial program 93.2%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6459.2

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified59.2%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6460.9

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified60.9%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 6: 42.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-67}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(\left(a \cdot a\right) \cdot \left(b \cdot 0.5\right), b, 1\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right), 1\right)\\


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

    1. Initial program 98.4%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6453.4

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified53.4%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6432.5

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified32.5%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6432.2

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified32.2%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
    12. Taylor expanded in a around inf

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
    13. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
      2. unpow2N/A

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

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \color{blue}{\left(a \cdot {b}^{2}\right)}\right)\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
      7. *-lowering-*.f6440.0

        \[\leadsto x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
    14. Simplified40.0%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)} \]

    if 0.0 < (*.f64 x (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))))) < 4.9999999999999999e-67

    1. Initial program 67.3%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6467.3

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified67.3%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6445.8

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified45.8%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6445.8

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified45.8%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
    12. Step-by-step derivation
      1. associate-*r*N/A

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

        \[\leadsto x \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot b\right) \cdot b\right)} + 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(a \cdot a\right) \cdot \left(\frac{1}{2} \cdot b\right)\right) \cdot b} + 1\right) \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(\left(a \cdot a\right) \cdot \left(\frac{1}{2} \cdot b\right), b, 1\right)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(\color{blue}{\left(a \cdot a\right) \cdot \left(\frac{1}{2} \cdot b\right)}, b, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(\color{blue}{\left(a \cdot a\right)} \cdot \left(\frac{1}{2} \cdot b\right), b, 1\right) \]
      7. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(\left(a \cdot a\right) \cdot \color{blue}{\left(b \cdot \frac{1}{2}\right)}, b, 1\right) \]
      8. *-lowering-*.f6497.3

        \[\leadsto x \cdot \mathsf{fma}\left(\left(a \cdot a\right) \cdot \color{blue}{\left(b \cdot 0.5\right)}, b, 1\right) \]
    13. Applied egg-rr97.3%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(\left(a \cdot a\right) \cdot \left(b \cdot 0.5\right), b, 1\right)} \]

    if 4.9999999999999999e-67 < (*.f64 x (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))))

    1. Initial program 93.2%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6459.2

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified59.2%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6460.9

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified60.9%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6460.9

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified60.9%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 50.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\
t_2 := x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) < 0.0 or 10 < (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))))

    1. Initial program 96.7%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6447.6

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified47.6%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6429.9

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified29.9%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6430.0

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified30.0%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
    12. Taylor expanded in a around inf

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
    13. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
      2. unpow2N/A

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

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \color{blue}{\left(a \cdot {b}^{2}\right)}\right)\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
      7. *-lowering-*.f6448.3

        \[\leadsto x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
    14. Simplified48.3%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)} \]

    if 0.0 < (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) < 10

    1. Initial program 93.6%

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
      2. --lowering--.f64N/A

        \[\leadsto x \cdot e^{a \cdot \color{blue}{\left(\log \left(1 - z\right) - b\right)}} \]
      3. sub-negN/A

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)} - b\right)} \]
      4. accelerator-lowering-log1p.f64N/A

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(\mathsf{neg}\left(z\right)\right)} - b\right)} \]
      5. neg-lowering-neg.f6496.2

        \[\leadsto x \cdot e^{a \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right)} \]
    5. Simplified96.2%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot e^{-1 \cdot \left(a \cdot b\right) + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z + -1 \cdot \left(a \cdot b\right)}} \]
      3. associate-*r*N/A

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      4. distribute-lft-outN/A

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      6. mul-1-negN/A

        \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(z + b\right)} \]
      7. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(z + b\right)} \]
      8. +-lowering-+.f6496.2

        \[\leadsto x \cdot e^{\left(-a\right) \cdot \color{blue}{\left(z + b\right)}} \]
    8. Simplified96.2%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
    9. Taylor expanded in a around 0

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

        \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot \left(b + z\right)\right)\right) + x} \]
      2. mul-1-negN/A

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

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

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(a \cdot \left(b + z\right)\right) \cdot x}\right)\right) + x \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(a \cdot \left(b + z\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)} + x \]
      6. neg-mul-1N/A

        \[\leadsto \left(a \cdot \left(b + z\right)\right) \cdot \color{blue}{\left(-1 \cdot x\right)} + x \]
      7. accelerator-lowering-fma.f64N/A

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

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

        \[\leadsto \mathsf{fma}\left(a \cdot \color{blue}{\left(b + z\right)}, -1 \cdot x, x\right) \]
      10. neg-mul-1N/A

        \[\leadsto \mathsf{fma}\left(a \cdot \left(b + z\right), \color{blue}{\mathsf{neg}\left(x\right)}, x\right) \]
      11. neg-lowering-neg.f6489.6

        \[\leadsto \mathsf{fma}\left(a \cdot \left(b + z\right), \color{blue}{-x}, x\right) \]
    11. Simplified89.6%

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

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

Alternative 8: 50.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5.5 \cdot 10^{+250}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(a, \left(z + b\right) \cdot \left(0.5 \cdot \left(z + b\right)\right), -b\right) - z, 1\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), -t\right), 1\right)\\


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

    1. Initial program 98.0%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6442.0

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified42.0%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f642.9

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified2.9%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f642.9

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified2.9%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
    12. Taylor expanded in a around inf

      \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
    13. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
      2. unpow2N/A

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

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \color{blue}{\left(a \cdot {b}^{2}\right)}\right)\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
      7. *-lowering-*.f6442.1

        \[\leadsto x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
    14. Simplified42.1%

      \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)} \]

    if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 5.4999999999999999e250

    1. Initial program 96.4%

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
      2. --lowering--.f64N/A

        \[\leadsto x \cdot e^{a \cdot \color{blue}{\left(\log \left(1 - z\right) - b\right)}} \]
      3. sub-negN/A

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)} - b\right)} \]
      4. accelerator-lowering-log1p.f64N/A

        \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(\mathsf{neg}\left(z\right)\right)} - b\right)} \]
      5. neg-lowering-neg.f6473.6

        \[\leadsto x \cdot e^{a \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right)} \]
    5. Simplified73.6%

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    6. Taylor expanded in z around 0

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot e^{-1 \cdot \left(a \cdot b\right) + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z + -1 \cdot \left(a \cdot b\right)}} \]
      3. associate-*r*N/A

        \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
      4. distribute-lft-outN/A

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      6. mul-1-negN/A

        \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(z + b\right)} \]
      7. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(z + b\right)} \]
      8. +-lowering-+.f6473.6

        \[\leadsto x \cdot e^{\left(-a\right) \cdot \color{blue}{\left(z + b\right)}} \]
    8. Simplified73.6%

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
    9. Taylor expanded in a around 0

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

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

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

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \left(0.5 \cdot \left(b + z\right)\right) \cdot \left(b + z\right), -b\right) - z, 1\right)} \]

    if 5.4999999999999999e250 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

    1. Initial program 91.8%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(t \cdot y\right)}} \]
      2. *-commutativeN/A

        \[\leadsto x \cdot e^{\mathsf{neg}\left(\color{blue}{y \cdot t}\right)} \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
      5. neg-lowering-neg.f6464.4

        \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-t\right)}} \]
    5. Simplified64.4%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0

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

        \[\leadsto x \cdot \color{blue}{\left(y \cdot \left(-1 \cdot t + \frac{1}{2} \cdot \left({t}^{2} \cdot y\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(y, -1 \cdot t + \frac{1}{2} \cdot \left({t}^{2} \cdot y\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} + \frac{1}{2} \cdot \left({t}^{2} \cdot y\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \color{blue}{\frac{1}{2} \cdot \left({t}^{2} \cdot y\right) + \left(\mathsf{neg}\left(t\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {t}^{2} \cdot y, \mathsf{neg}\left(t\right)\right)}, 1\right) \]
      6. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{y \cdot {t}^{2}}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{y \cdot {t}^{2}}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      8. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, y \cdot \color{blue}{\left(t \cdot t\right)}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{1}{2}, y \cdot \color{blue}{\left(t \cdot t\right)}, \mathsf{neg}\left(t\right)\right), 1\right) \]
      10. neg-lowering-neg.f6468.5

        \[\leadsto x \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), \color{blue}{-t}\right), 1\right) \]
    8. Simplified68.5%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(y, \mathsf{fma}\left(0.5, y \cdot \left(t \cdot t\right), -t\right), 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.1%

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

Alternative 9: 46.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(0.5 \cdot \left(x \cdot \left(a \cdot \left(a \cdot b\right)\right)\right)\right)\\ t_2 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\ \mathbf{if}\;t\_2 \leq -2000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+94}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (* 0.5 (* x (* a (* a b))))))
        (t_2 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
   (if (<= t_2 -2000.0) t_1 (if (<= t_2 2e+94) (- x (* t (* x y))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = b * (0.5 * (x * (a * (a * b))));
	double t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
	double tmp;
	if (t_2 <= -2000.0) {
		tmp = t_1;
	} else if (t_2 <= 2e+94) {
		tmp = x - (t * (x * y));
	} 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) :: t_2
    real(8) :: tmp
    t_1 = b * (0.5d0 * (x * (a * (a * b))))
    t_2 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
    if (t_2 <= (-2000.0d0)) then
        tmp = t_1
    else if (t_2 <= 2d+94) then
        tmp = x - (t * (x * y))
    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 = b * (0.5 * (x * (a * (a * b))));
	double t_2 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
	double tmp;
	if (t_2 <= -2000.0) {
		tmp = t_1;
	} else if (t_2 <= 2e+94) {
		tmp = x - (t * (x * y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = b * (0.5 * (x * (a * (a * b))))
	t_2 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))
	tmp = 0
	if t_2 <= -2000.0:
		tmp = t_1
	elif t_2 <= 2e+94:
		tmp = x - (t * (x * y))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(b * Float64(0.5 * Float64(x * Float64(a * Float64(a * b)))))
	t_2 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))
	tmp = 0.0
	if (t_2 <= -2000.0)
		tmp = t_1;
	elseif (t_2 <= 2e+94)
		tmp = Float64(x - Float64(t * Float64(x * y)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = b * (0.5 * (x * (a * (a * b))));
	t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
	tmp = 0.0;
	if (t_2 <= -2000.0)
		tmp = t_1;
	elseif (t_2 <= 2e+94)
		tmp = x - (t * (x * y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(0.5 * N[(x * N[(a * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2000.0], t$95$1, If[LessEqual[t$95$2, 2e+94], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+94}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3 or 2e94 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

    1. Initial program 96.9%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6449.0

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified49.0%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6430.0

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified30.0%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around inf

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
      2. *-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
      6. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
      7. *-lowering-*.f6430.0

        \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
    11. Simplified30.0%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
    12. Taylor expanded in a around inf

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot x\right)\right)} \]
    13. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot \left({b}^{2} \cdot x\right)} \]
      2. unpow2N/A

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

        \[\leadsto \left(\frac{1}{2} \cdot {a}^{2}\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot x\right)\right)} \]
      4. *-commutativeN/A

        \[\leadsto \left(\frac{1}{2} \cdot {a}^{2}\right) \cdot \color{blue}{\left(\left(b \cdot x\right) \cdot b\right)} \]
      5. associate-*l*N/A

        \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot {a}^{2}\right) \cdot \left(b \cdot x\right)\right) \cdot b} \]
      6. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right)\right)} \cdot b \]
      7. *-commutativeN/A

        \[\leadsto \color{blue}{b \cdot \left(\frac{1}{2} \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right)\right)} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{b \cdot \left(\frac{1}{2} \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right)\right)} \]
      9. *-lowering-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right)\right)} \]
      10. associate-*r*N/A

        \[\leadsto b \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(\left({a}^{2} \cdot b\right) \cdot x\right)}\right) \]
      11. *-commutativeN/A

        \[\leadsto b \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(x \cdot \left({a}^{2} \cdot b\right)\right)}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto b \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(x \cdot \left({a}^{2} \cdot b\right)\right)}\right) \]
      13. unpow2N/A

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

        \[\leadsto b \cdot \left(\frac{1}{2} \cdot \left(x \cdot \color{blue}{\left(a \cdot \left(a \cdot b\right)\right)}\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto b \cdot \left(\frac{1}{2} \cdot \left(x \cdot \color{blue}{\left(a \cdot \left(a \cdot b\right)\right)}\right)\right) \]
      16. *-lowering-*.f6444.7

        \[\leadsto b \cdot \left(0.5 \cdot \left(x \cdot \left(a \cdot \color{blue}{\left(a \cdot b\right)}\right)\right)\right) \]
    14. Simplified44.7%

      \[\leadsto \color{blue}{b \cdot \left(0.5 \cdot \left(x \cdot \left(a \cdot \left(a \cdot b\right)\right)\right)\right)} \]

    if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2e94

    1. Initial program 93.5%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(t \cdot y\right)}} \]
      2. *-commutativeN/A

        \[\leadsto x \cdot e^{\mathsf{neg}\left(\color{blue}{y \cdot t}\right)} \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
      5. neg-lowering-neg.f6476.7

        \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-t\right)}} \]
    5. Simplified76.7%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]
    6. Taylor expanded in y around 0

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

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

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto x - \color{blue}{t \cdot \left(x \cdot y\right)} \]
      5. *-lowering-*.f6469.1

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

      \[\leadsto \color{blue}{x - t \cdot \left(x \cdot y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 33.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -x \cdot \left(a \cdot b\right)\\ t_2 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\ \mathbf{if}\;t\_2 \leq -2000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+94}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (* x (* a b))))
        (t_2 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
   (if (<= t_2 -2000.0) t_1 (if (<= t_2 2e+94) x t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = -(x * (a * b));
	double t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
	double tmp;
	if (t_2 <= -2000.0) {
		tmp = t_1;
	} else if (t_2 <= 2e+94) {
		tmp = x;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = -(x * (a * b))
    t_2 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
    if (t_2 <= (-2000.0d0)) then
        tmp = t_1
    else if (t_2 <= 2d+94) then
        tmp = x
    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 = -(x * (a * b));
	double t_2 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
	double tmp;
	if (t_2 <= -2000.0) {
		tmp = t_1;
	} else if (t_2 <= 2e+94) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = -(x * (a * b))
	t_2 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))
	tmp = 0
	if t_2 <= -2000.0:
		tmp = t_1
	elif t_2 <= 2e+94:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(-Float64(x * Float64(a * b)))
	t_2 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))
	tmp = 0.0
	if (t_2 <= -2000.0)
		tmp = t_1;
	elseif (t_2 <= 2e+94)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = -(x * (a * b));
	t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
	tmp = 0.0;
	if (t_2 <= -2000.0)
		tmp = t_1;
	elseif (t_2 <= 2e+94)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = (-N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$2 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2000.0], t$95$1, If[LessEqual[t$95$2, 2e+94], x, t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+94}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3 or 2e94 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

    1. Initial program 96.9%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
      3. *-lowering-*.f6449.0

        \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
    5. Simplified49.0%

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    6. Taylor expanded in a around 0

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
      3. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
      4. +-commutativeN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
      5. accelerator-lowering-fma.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      7. unpow2N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
      9. neg-lowering-neg.f6430.0

        \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
    8. Simplified30.0%

      \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
    9. Taylor expanded in a around 0

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-1 \cdot b}, 1\right) \]
    10. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(b\right)}, 1\right) \]
      2. neg-lowering-neg.f6415.3

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-b}, 1\right) \]
    11. Simplified15.3%

      \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-b}, 1\right) \]
    12. Taylor expanded in a around inf

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(a \cdot b\right)\right)} \]
    13. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto x \cdot \color{blue}{\left(\mathsf{neg}\left(a \cdot b\right)\right)} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\mathsf{neg}\left(a \cdot b\right)\right)} \]
      3. *-lowering-*.f6426.3

        \[\leadsto x \cdot \left(-\color{blue}{a \cdot b}\right) \]
    14. Simplified26.3%

      \[\leadsto x \cdot \color{blue}{\left(-a \cdot b\right)} \]

    if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2e94

    1. Initial program 93.5%

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

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
      2. --lowering--.f64N/A

        \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(\log z - t\right)}} \]
      3. log-lowering-log.f6486.0

        \[\leadsto x \cdot e^{y \cdot \left(\color{blue}{\log z} - t\right)} \]
    5. Simplified86.0%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
    6. Taylor expanded in y around 0

      \[\leadsto \color{blue}{x} \]
    7. Step-by-step derivation
      1. Simplified67.5%

        \[\leadsto \color{blue}{x} \]
    8. Recombined 2 regimes into one program.
    9. Final simplification36.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2000:\\ \;\;\;\;-x \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 2 \cdot 10^{+94}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-x \cdot \left(a \cdot b\right)\\ \end{array} \]
    10. Add Preprocessing

    Alternative 11: 32.8% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := -a \cdot \left(x \cdot b\right)\\ t_2 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\ \mathbf{if}\;t\_2 \leq -2000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+94}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (- (* a (* x b))))
            (t_2 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
       (if (<= t_2 -2000.0) t_1 (if (<= t_2 2e+94) x t_1))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = -(a * (x * b));
    	double t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
    	double tmp;
    	if (t_2 <= -2000.0) {
    		tmp = t_1;
    	} else if (t_2 <= 2e+94) {
    		tmp = x;
    	} 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) :: t_2
        real(8) :: tmp
        t_1 = -(a * (x * b))
        t_2 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
        if (t_2 <= (-2000.0d0)) then
            tmp = t_1
        else if (t_2 <= 2d+94) then
            tmp = x
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = -(a * (x * b));
    	double t_2 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
    	double tmp;
    	if (t_2 <= -2000.0) {
    		tmp = t_1;
    	} else if (t_2 <= 2e+94) {
    		tmp = x;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	t_1 = -(a * (x * b))
    	t_2 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))
    	tmp = 0
    	if t_2 <= -2000.0:
    		tmp = t_1
    	elif t_2 <= 2e+94:
    		tmp = x
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(-Float64(a * Float64(x * b)))
    	t_2 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))
    	tmp = 0.0
    	if (t_2 <= -2000.0)
    		tmp = t_1;
    	elseif (t_2 <= 2e+94)
    		tmp = x;
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b)
    	t_1 = -(a * (x * b));
    	t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
    	tmp = 0.0;
    	if (t_2 <= -2000.0)
    		tmp = t_1;
    	elseif (t_2 <= 2e+94)
    		tmp = x;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = (-N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$2 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2000.0], t$95$1, If[LessEqual[t$95$2, 2e+94], x, t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := -a \cdot \left(x \cdot b\right)\\
    t_2 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
    \mathbf{if}\;t\_2 \leq -2000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+94}:\\
    \;\;\;\;x\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3 or 2e94 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

      1. Initial program 96.9%

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

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

          \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
        2. neg-lowering-neg.f64N/A

          \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
        3. *-lowering-*.f6449.0

          \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
      5. Simplified49.0%

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      6. Taylor expanded in a around 0

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

          \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
        2. accelerator-lowering-fma.f64N/A

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
        3. mul-1-negN/A

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
        4. +-commutativeN/A

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
        5. accelerator-lowering-fma.f64N/A

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
        7. unpow2N/A

          \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
        9. neg-lowering-neg.f6430.0

          \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
      8. Simplified30.0%

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
      9. Taylor expanded in a around 0

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-1 \cdot b}, 1\right) \]
      10. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(b\right)}, 1\right) \]
        2. neg-lowering-neg.f6415.3

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-b}, 1\right) \]
      11. Simplified15.3%

        \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-b}, 1\right) \]
      12. Taylor expanded in a around inf

        \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
      13. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(a \cdot \left(b \cdot x\right)\right)} \]
        2. distribute-rgt-neg-inN/A

          \[\leadsto \color{blue}{a \cdot \left(\mathsf{neg}\left(b \cdot x\right)\right)} \]
        3. mul-1-negN/A

          \[\leadsto a \cdot \color{blue}{\left(-1 \cdot \left(b \cdot x\right)\right)} \]
        4. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \left(b \cdot x\right)\right)} \]
        5. mul-1-negN/A

          \[\leadsto a \cdot \color{blue}{\left(\mathsf{neg}\left(b \cdot x\right)\right)} \]
        6. distribute-rgt-neg-inN/A

          \[\leadsto a \cdot \color{blue}{\left(b \cdot \left(\mathsf{neg}\left(x\right)\right)\right)} \]
        7. mul-1-negN/A

          \[\leadsto a \cdot \left(b \cdot \color{blue}{\left(-1 \cdot x\right)}\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto a \cdot \color{blue}{\left(b \cdot \left(-1 \cdot x\right)\right)} \]
        9. mul-1-negN/A

          \[\leadsto a \cdot \left(b \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right) \]
        10. neg-lowering-neg.f6425.8

          \[\leadsto a \cdot \left(b \cdot \color{blue}{\left(-x\right)}\right) \]
      14. Simplified25.8%

        \[\leadsto \color{blue}{a \cdot \left(b \cdot \left(-x\right)\right)} \]

      if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2e94

      1. Initial program 93.5%

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

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
        2. --lowering--.f64N/A

          \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(\log z - t\right)}} \]
        3. log-lowering-log.f6486.0

          \[\leadsto x \cdot e^{y \cdot \left(\color{blue}{\log z} - t\right)} \]
      5. Simplified86.0%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
      6. Taylor expanded in y around 0

        \[\leadsto \color{blue}{x} \]
      7. Step-by-step derivation
        1. Simplified67.5%

          \[\leadsto \color{blue}{x} \]
      8. Recombined 2 regimes into one program.
      9. Final simplification35.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2000:\\ \;\;\;\;-a \cdot \left(x \cdot b\right)\\ \mathbf{elif}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 2 \cdot 10^{+94}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-a \cdot \left(x \cdot b\right)\\ \end{array} \]
      10. Add Preprocessing

      Alternative 12: 42.1% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \leq 0:\\ \;\;\;\;x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right), 1\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (<= (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))) 0.0)
         (* x (* 0.5 (* a (* a (* b b)))))
         (* x (fma a (* a (* 0.5 (* b b))) 1.0))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if ((x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))))) <= 0.0) {
      		tmp = x * (0.5 * (a * (a * (b * b))));
      	} else {
      		tmp = x * fma(a, (a * (0.5 * (b * b))), 1.0);
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if (Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) <= 0.0)
      		tmp = Float64(x * Float64(0.5 * Float64(a * Float64(a * Float64(b * b)))));
      	else
      		tmp = Float64(x * fma(a, Float64(a * Float64(0.5 * Float64(b * b))), 1.0));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.0], N[(x * N[(0.5 * N[(a * N[(a * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * N[(a * N[(0.5 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \leq 0:\\
      \;\;\;\;x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right), 1\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 x (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))))) < 0.0

        1. Initial program 98.4%

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

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

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          3. *-lowering-*.f6453.4

            \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
        5. Simplified53.4%

          \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
        6. Taylor expanded in a around 0

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

            \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
          2. accelerator-lowering-fma.f64N/A

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
          3. mul-1-negN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
          4. +-commutativeN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
          5. accelerator-lowering-fma.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          7. unpow2N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          9. neg-lowering-neg.f6432.5

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
        8. Simplified32.5%

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
        9. Taylor expanded in a around inf

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
        10. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
          2. *-commutativeN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
          3. associate-*r*N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
          6. unpow2N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
          7. *-lowering-*.f6432.2

            \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
        11. Simplified32.2%

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
        12. Taylor expanded in a around inf

          \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
        13. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot {b}^{2}\right)\right)} \]
          2. unpow2N/A

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

            \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(a \cdot \left(a \cdot {b}^{2}\right)\right)}\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \color{blue}{\left(a \cdot {b}^{2}\right)}\right)\right) \]
          6. unpow2N/A

            \[\leadsto x \cdot \left(\frac{1}{2} \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
          7. *-lowering-*.f6440.0

            \[\leadsto x \cdot \left(0.5 \cdot \left(a \cdot \left(a \cdot \color{blue}{\left(b \cdot b\right)}\right)\right)\right) \]
        14. Simplified40.0%

          \[\leadsto x \cdot \color{blue}{\left(0.5 \cdot \left(a \cdot \left(a \cdot \left(b \cdot b\right)\right)\right)\right)} \]

        if 0.0 < (*.f64 x (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))))

        1. Initial program 89.8%

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

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

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          3. *-lowering-*.f6460.3

            \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
        5. Simplified60.3%

          \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
        6. Taylor expanded in a around 0

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

            \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
          2. accelerator-lowering-fma.f64N/A

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
          3. mul-1-negN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
          4. +-commutativeN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
          5. accelerator-lowering-fma.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          7. unpow2N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          9. neg-lowering-neg.f6458.9

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
        8. Simplified58.9%

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
        9. Taylor expanded in a around inf

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)}, 1\right) \]
        10. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\frac{1}{2} \cdot a\right) \cdot {b}^{2}}, 1\right) \]
          2. *-commutativeN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(a \cdot \frac{1}{2}\right)} \cdot {b}^{2}, 1\right) \]
          3. associate-*r*N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \color{blue}{\left(\frac{1}{2} \cdot {b}^{2}\right)}, 1\right) \]
          6. unpow2N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(\frac{1}{2} \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
          7. *-lowering-*.f6458.9

            \[\leadsto x \cdot \mathsf{fma}\left(a, a \cdot \left(0.5 \cdot \color{blue}{\left(b \cdot b\right)}\right), 1\right) \]
        11. Simplified58.9%

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{a \cdot \left(0.5 \cdot \left(b \cdot b\right)\right)}, 1\right) \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 13: 34.7% accurate, 1.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2000:\\ \;\;\;\;-x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot \left(z + b\right), -x, x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) -2000.0)
         (- (* x (* a b)))
         (fma (* a (+ z b)) (- x) x)))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= -2000.0) {
      		tmp = -(x * (a * b));
      	} else {
      		tmp = fma((a * (z + b)), -x, x);
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if (Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) <= -2000.0)
      		tmp = Float64(-Float64(x * Float64(a * b)));
      	else
      		tmp = fma(Float64(a * Float64(z + b)), Float64(-x), x);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2000.0], (-N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), N[(N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision] * (-x) + x), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2000:\\
      \;\;\;\;-x \cdot \left(a \cdot b\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(a \cdot \left(z + b\right), -x, x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3

        1. Initial program 98.0%

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

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

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          3. *-lowering-*.f6442.0

            \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
        5. Simplified42.0%

          \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
        6. Taylor expanded in a around 0

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

            \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
          2. accelerator-lowering-fma.f64N/A

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
          3. mul-1-negN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
          4. +-commutativeN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
          5. accelerator-lowering-fma.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          7. unpow2N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          9. neg-lowering-neg.f642.9

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
        8. Simplified2.9%

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
        9. Taylor expanded in a around 0

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-1 \cdot b}, 1\right) \]
        10. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(b\right)}, 1\right) \]
          2. neg-lowering-neg.f643.2

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-b}, 1\right) \]
        11. Simplified3.2%

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-b}, 1\right) \]
        12. Taylor expanded in a around inf

          \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(a \cdot b\right)\right)} \]
        13. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto x \cdot \color{blue}{\left(\mathsf{neg}\left(a \cdot b\right)\right)} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot \color{blue}{\left(\mathsf{neg}\left(a \cdot b\right)\right)} \]
          3. *-lowering-*.f6425.9

            \[\leadsto x \cdot \left(-\color{blue}{a \cdot b}\right) \]
        14. Simplified25.9%

          \[\leadsto x \cdot \color{blue}{\left(-a \cdot b\right)} \]

        if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

        1. Initial program 95.0%

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

          \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
          2. --lowering--.f64N/A

            \[\leadsto x \cdot e^{a \cdot \color{blue}{\left(\log \left(1 - z\right) - b\right)}} \]
          3. sub-negN/A

            \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)} - b\right)} \]
          4. accelerator-lowering-log1p.f64N/A

            \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(\mathsf{neg}\left(z\right)\right)} - b\right)} \]
          5. neg-lowering-neg.f6468.3

            \[\leadsto x \cdot e^{a \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right)} \]
        5. Simplified68.3%

          \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
        6. Taylor expanded in z around 0

          \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
        7. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto x \cdot e^{-1 \cdot \left(a \cdot b\right) + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
          2. +-commutativeN/A

            \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z + -1 \cdot \left(a \cdot b\right)}} \]
          3. associate-*r*N/A

            \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
          4. distribute-lft-outN/A

            \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
          5. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
          6. mul-1-negN/A

            \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(z + b\right)} \]
          7. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(z + b\right)} \]
          8. +-lowering-+.f6468.3

            \[\leadsto x \cdot e^{\left(-a\right) \cdot \color{blue}{\left(z + b\right)}} \]
        8. Simplified68.3%

          \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
        9. Taylor expanded in a around 0

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

            \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot \left(b + z\right)\right)\right) + x} \]
          2. mul-1-negN/A

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

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

            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(a \cdot \left(b + z\right)\right) \cdot x}\right)\right) + x \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \color{blue}{\left(a \cdot \left(b + z\right)\right) \cdot \left(\mathsf{neg}\left(x\right)\right)} + x \]
          6. neg-mul-1N/A

            \[\leadsto \left(a \cdot \left(b + z\right)\right) \cdot \color{blue}{\left(-1 \cdot x\right)} + x \]
          7. accelerator-lowering-fma.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(a \cdot \color{blue}{\left(b + z\right)}, -1 \cdot x, x\right) \]
          10. neg-mul-1N/A

            \[\leadsto \mathsf{fma}\left(a \cdot \left(b + z\right), \color{blue}{\mathsf{neg}\left(x\right)}, x\right) \]
          11. neg-lowering-neg.f6443.3

            \[\leadsto \mathsf{fma}\left(a \cdot \left(b + z\right), \color{blue}{-x}, x\right) \]
        11. Simplified43.3%

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

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

      Alternative 14: 34.3% accurate, 1.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2000:\\ \;\;\;\;-x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) -2000.0)
         (- (* x (* a b)))
         (* x (- 1.0 (* a b)))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= -2000.0) {
      		tmp = -(x * (a * b));
      	} else {
      		tmp = x * (1.0 - (a * b));
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z, t, a, b)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8) :: tmp
          if (((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))) <= (-2000.0d0)) then
              tmp = -(x * (a * b))
          else
              tmp = x * (1.0d0 - (a * b))
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if (((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))) <= -2000.0) {
      		tmp = -(x * (a * b));
      	} else {
      		tmp = x * (1.0 - (a * b));
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	tmp = 0
      	if ((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))) <= -2000.0:
      		tmp = -(x * (a * b))
      	else:
      		tmp = x * (1.0 - (a * b))
      	return tmp
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if (Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) <= -2000.0)
      		tmp = Float64(-Float64(x * Float64(a * b)));
      	else
      		tmp = Float64(x * Float64(1.0 - Float64(a * b)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	tmp = 0.0;
      	if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= -2000.0)
      		tmp = -(x * (a * b));
      	else
      		tmp = x * (1.0 - (a * b));
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2000.0], (-N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2000:\\
      \;\;\;\;-x \cdot \left(a \cdot b\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e3

        1. Initial program 98.0%

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

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

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          3. *-lowering-*.f6442.0

            \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
        5. Simplified42.0%

          \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
        6. Taylor expanded in a around 0

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

            \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right)\right) + 1\right)} \]
          2. accelerator-lowering-fma.f64N/A

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, -1 \cdot b + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right)} \]
          3. mul-1-negN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \frac{1}{2} \cdot \left(a \cdot {b}^{2}\right), 1\right) \]
          4. +-commutativeN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\frac{1}{2} \cdot \left(a \cdot {b}^{2}\right) + \left(\mathsf{neg}\left(b\right)\right)}, 1\right) \]
          5. accelerator-lowering-fma.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, a \cdot {b}^{2}, \mathsf{neg}\left(b\right)\right)}, 1\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{a \cdot {b}^{2}}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          7. unpow2N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{1}{2}, a \cdot \color{blue}{\left(b \cdot b\right)}, \mathsf{neg}\left(b\right)\right), 1\right) \]
          9. neg-lowering-neg.f642.9

            \[\leadsto x \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), \color{blue}{-b}\right), 1\right) \]
        8. Simplified2.9%

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(0.5, a \cdot \left(b \cdot b\right), -b\right), 1\right)} \]
        9. Taylor expanded in a around 0

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-1 \cdot b}, 1\right) \]
        10. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{\mathsf{neg}\left(b\right)}, 1\right) \]
          2. neg-lowering-neg.f643.2

            \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-b}, 1\right) \]
        11. Simplified3.2%

          \[\leadsto x \cdot \mathsf{fma}\left(a, \color{blue}{-b}, 1\right) \]
        12. Taylor expanded in a around inf

          \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \left(a \cdot b\right)\right)} \]
        13. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto x \cdot \color{blue}{\left(\mathsf{neg}\left(a \cdot b\right)\right)} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot \color{blue}{\left(\mathsf{neg}\left(a \cdot b\right)\right)} \]
          3. *-lowering-*.f6425.9

            \[\leadsto x \cdot \left(-\color{blue}{a \cdot b}\right) \]
        14. Simplified25.9%

          \[\leadsto x \cdot \color{blue}{\left(-a \cdot b\right)} \]

        if -2e3 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

        1. Initial program 95.0%

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

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

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          3. *-lowering-*.f6463.4

            \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
        5. Simplified63.4%

          \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
        6. Taylor expanded in a around 0

          \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot b\right)\right)} \]
        7. Step-by-step derivation
          1. neg-mul-1N/A

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

            \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
          3. --lowering--.f64N/A

            \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
          4. *-lowering-*.f6443.3

            \[\leadsto x \cdot \left(1 - \color{blue}{a \cdot b}\right) \]
        8. Simplified43.3%

          \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification36.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2000:\\ \;\;\;\;-x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 15: 86.9% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{if}\;y \leq -1.62 \cdot 10^{-43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-5}:\\ \;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (let* ((t_1 (* x (exp (* y (- (log z) t))))))
         (if (<= y -1.62e-43)
           t_1
           (if (<= y 8.2e-5) (* x (exp (- (* a (+ z b))))) t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = x * exp((y * (log(z) - t)));
      	double tmp;
      	if (y <= -1.62e-43) {
      		tmp = t_1;
      	} else if (y <= 8.2e-5) {
      		tmp = x * exp(-(a * (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 = x * exp((y * (log(z) - t)))
          if (y <= (-1.62d-43)) then
              tmp = t_1
          else if (y <= 8.2d-5) then
              tmp = x * exp(-(a * (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 = x * Math.exp((y * (Math.log(z) - t)));
      	double tmp;
      	if (y <= -1.62e-43) {
      		tmp = t_1;
      	} else if (y <= 8.2e-5) {
      		tmp = x * Math.exp(-(a * (z + b)));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = x * math.exp((y * (math.log(z) - t)))
      	tmp = 0
      	if y <= -1.62e-43:
      		tmp = t_1
      	elif y <= 8.2e-5:
      		tmp = x * math.exp(-(a * (z + b)))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(x * exp(Float64(y * Float64(log(z) - t))))
      	tmp = 0.0
      	if (y <= -1.62e-43)
      		tmp = t_1;
      	elseif (y <= 8.2e-5)
      		tmp = Float64(x * exp(Float64(-Float64(a * Float64(z + b)))));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	t_1 = x * exp((y * (log(z) - t)));
      	tmp = 0.0;
      	if (y <= -1.62e-43)
      		tmp = t_1;
      	elseif (y <= 8.2e-5)
      		tmp = x * exp(-(a * (z + b)));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.62e-43], t$95$1, If[LessEqual[y, 8.2e-5], N[(x * N[Exp[(-N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := x \cdot e^{y \cdot \left(\log z - t\right)}\\
      \mathbf{if}\;y \leq -1.62 \cdot 10^{-43}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 8.2 \cdot 10^{-5}:\\
      \;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -1.6199999999999999e-43 or 8.20000000000000009e-5 < y

        1. Initial program 97.2%

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

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
          2. --lowering--.f64N/A

            \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(\log z - t\right)}} \]
          3. log-lowering-log.f6487.8

            \[\leadsto x \cdot e^{y \cdot \left(\color{blue}{\log z} - t\right)} \]
        5. Simplified87.8%

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]

        if -1.6199999999999999e-43 < y < 8.20000000000000009e-5

        1. Initial program 94.7%

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

          \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
          2. --lowering--.f64N/A

            \[\leadsto x \cdot e^{a \cdot \color{blue}{\left(\log \left(1 - z\right) - b\right)}} \]
          3. sub-negN/A

            \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)} - b\right)} \]
          4. accelerator-lowering-log1p.f64N/A

            \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(\mathsf{neg}\left(z\right)\right)} - b\right)} \]
          5. neg-lowering-neg.f6492.2

            \[\leadsto x \cdot e^{a \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right)} \]
        5. Simplified92.2%

          \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
        6. Taylor expanded in z around 0

          \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
        7. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto x \cdot e^{-1 \cdot \left(a \cdot b\right) + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
          2. +-commutativeN/A

            \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z + -1 \cdot \left(a \cdot b\right)}} \]
          3. associate-*r*N/A

            \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
          4. distribute-lft-outN/A

            \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
          5. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
          6. mul-1-negN/A

            \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(z + b\right)} \]
          7. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(z + b\right)} \]
          8. +-lowering-+.f6492.2

            \[\leadsto x \cdot e^{\left(-a\right) \cdot \color{blue}{\left(z + b\right)}} \]
        8. Simplified92.2%

          \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification89.7%

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

      Alternative 16: 71.4% accurate, 2.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot {z}^{y}\\ t_2 := x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{if}\;y \leq -1.25 \cdot 10^{+157}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+55}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 0.0015:\\ \;\;\;\;x \cdot e^{-a \cdot b}\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+148}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (let* ((t_1 (* x (pow z y))) (t_2 (* x (exp (* t (- y))))))
         (if (<= y -1.25e+157)
           t_2
           (if (<= y -2.2e+55)
             t_1
             (if (<= y 0.0015)
               (* x (exp (- (* a b))))
               (if (<= y 4.6e+148) t_1 t_2))))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = x * pow(z, y);
      	double t_2 = x * exp((t * -y));
      	double tmp;
      	if (y <= -1.25e+157) {
      		tmp = t_2;
      	} else if (y <= -2.2e+55) {
      		tmp = t_1;
      	} else if (y <= 0.0015) {
      		tmp = x * exp(-(a * b));
      	} else if (y <= 4.6e+148) {
      		tmp = t_1;
      	} else {
      		tmp = t_2;
      	}
      	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) :: tmp
          t_1 = x * (z ** y)
          t_2 = x * exp((t * -y))
          if (y <= (-1.25d+157)) then
              tmp = t_2
          else if (y <= (-2.2d+55)) then
              tmp = t_1
          else if (y <= 0.0015d0) then
              tmp = x * exp(-(a * b))
          else if (y <= 4.6d+148) then
              tmp = t_1
          else
              tmp = t_2
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = x * Math.pow(z, y);
      	double t_2 = x * Math.exp((t * -y));
      	double tmp;
      	if (y <= -1.25e+157) {
      		tmp = t_2;
      	} else if (y <= -2.2e+55) {
      		tmp = t_1;
      	} else if (y <= 0.0015) {
      		tmp = x * Math.exp(-(a * b));
      	} else if (y <= 4.6e+148) {
      		tmp = t_1;
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = x * math.pow(z, y)
      	t_2 = x * math.exp((t * -y))
      	tmp = 0
      	if y <= -1.25e+157:
      		tmp = t_2
      	elif y <= -2.2e+55:
      		tmp = t_1
      	elif y <= 0.0015:
      		tmp = x * math.exp(-(a * b))
      	elif y <= 4.6e+148:
      		tmp = t_1
      	else:
      		tmp = t_2
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(x * (z ^ y))
      	t_2 = Float64(x * exp(Float64(t * Float64(-y))))
      	tmp = 0.0
      	if (y <= -1.25e+157)
      		tmp = t_2;
      	elseif (y <= -2.2e+55)
      		tmp = t_1;
      	elseif (y <= 0.0015)
      		tmp = Float64(x * exp(Float64(-Float64(a * b))));
      	elseif (y <= 4.6e+148)
      		tmp = t_1;
      	else
      		tmp = t_2;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	t_1 = x * (z ^ y);
      	t_2 = x * exp((t * -y));
      	tmp = 0.0;
      	if (y <= -1.25e+157)
      		tmp = t_2;
      	elseif (y <= -2.2e+55)
      		tmp = t_1;
      	elseif (y <= 0.0015)
      		tmp = x * exp(-(a * b));
      	elseif (y <= 4.6e+148)
      		tmp = t_1;
      	else
      		tmp = t_2;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+157], t$95$2, If[LessEqual[y, -2.2e+55], t$95$1, If[LessEqual[y, 0.0015], N[(x * N[Exp[(-N[(a * b), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+148], t$95$1, t$95$2]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := x \cdot {z}^{y}\\
      t_2 := x \cdot e^{t \cdot \left(-y\right)}\\
      \mathbf{if}\;y \leq -1.25 \cdot 10^{+157}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;y \leq -2.2 \cdot 10^{+55}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 0.0015:\\
      \;\;\;\;x \cdot e^{-a \cdot b}\\
      
      \mathbf{elif}\;y \leq 4.6 \cdot 10^{+148}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -1.24999999999999994e157 or 4.6000000000000001e148 < y

        1. Initial program 94.2%

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

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

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(t \cdot y\right)}} \]
          2. *-commutativeN/A

            \[\leadsto x \cdot e^{\mathsf{neg}\left(\color{blue}{y \cdot t}\right)} \]
          3. distribute-rgt-neg-inN/A

            \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
          4. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
          5. neg-lowering-neg.f6472.0

            \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-t\right)}} \]
        5. Simplified72.0%

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]

        if -1.24999999999999994e157 < y < -2.2000000000000001e55 or 0.0015 < y < 4.6000000000000001e148

        1. Initial program 100.0%

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

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
          2. --lowering--.f64N/A

            \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(\log z - t\right)}} \]
          3. log-lowering-log.f6489.5

            \[\leadsto x \cdot e^{y \cdot \left(\color{blue}{\log z} - t\right)} \]
        5. Simplified89.5%

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
        6. Taylor expanded in t around 0

          \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
        7. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
          2. pow-lowering-pow.f6475.4

            \[\leadsto x \cdot \color{blue}{{z}^{y}} \]
        8. Simplified75.4%

          \[\leadsto \color{blue}{x \cdot {z}^{y}} \]

        if -2.2000000000000001e55 < y < 0.0015

        1. Initial program 95.5%

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

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

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          3. *-lowering-*.f6480.9

            \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
        5. Simplified80.9%

          \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification77.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+157}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{+55}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 0.0015:\\ \;\;\;\;x \cdot e^{-a \cdot b}\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+148}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 17: 73.9% accurate, 2.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{if}\;t \leq -4200000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 8 \cdot 10^{+146}:\\ \;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (let* ((t_1 (* x (exp (* t (- y))))))
         (if (<= t -4200000.0)
           t_1
           (if (<= t 8e+146) (* x (exp (- (* a (+ z b))))) t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = x * exp((t * -y));
      	double tmp;
      	if (t <= -4200000.0) {
      		tmp = t_1;
      	} else if (t <= 8e+146) {
      		tmp = x * exp(-(a * (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 = x * exp((t * -y))
          if (t <= (-4200000.0d0)) then
              tmp = t_1
          else if (t <= 8d+146) then
              tmp = x * exp(-(a * (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 = x * Math.exp((t * -y));
      	double tmp;
      	if (t <= -4200000.0) {
      		tmp = t_1;
      	} else if (t <= 8e+146) {
      		tmp = x * Math.exp(-(a * (z + b)));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = x * math.exp((t * -y))
      	tmp = 0
      	if t <= -4200000.0:
      		tmp = t_1
      	elif t <= 8e+146:
      		tmp = x * math.exp(-(a * (z + b)))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(x * exp(Float64(t * Float64(-y))))
      	tmp = 0.0
      	if (t <= -4200000.0)
      		tmp = t_1;
      	elseif (t <= 8e+146)
      		tmp = Float64(x * exp(Float64(-Float64(a * Float64(z + b)))));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	t_1 = x * exp((t * -y));
      	tmp = 0.0;
      	if (t <= -4200000.0)
      		tmp = t_1;
      	elseif (t <= 8e+146)
      		tmp = x * exp(-(a * (z + b)));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4200000.0], t$95$1, If[LessEqual[t, 8e+146], N[(x * N[Exp[(-N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := x \cdot e^{t \cdot \left(-y\right)}\\
      \mathbf{if}\;t \leq -4200000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t \leq 8 \cdot 10^{+146}:\\
      \;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -4.2e6 or 7.99999999999999947e146 < t

        1. Initial program 96.9%

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

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

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(t \cdot y\right)}} \]
          2. *-commutativeN/A

            \[\leadsto x \cdot e^{\mathsf{neg}\left(\color{blue}{y \cdot t}\right)} \]
          3. distribute-rgt-neg-inN/A

            \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
          4. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\mathsf{neg}\left(t\right)\right)}} \]
          5. neg-lowering-neg.f6485.5

            \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-t\right)}} \]
        5. Simplified85.5%

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)}} \]

        if -4.2e6 < t < 7.99999999999999947e146

        1. Initial program 95.7%

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

          \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
          2. --lowering--.f64N/A

            \[\leadsto x \cdot e^{a \cdot \color{blue}{\left(\log \left(1 - z\right) - b\right)}} \]
          3. sub-negN/A

            \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(\mathsf{neg}\left(z\right)\right)\right)} - b\right)} \]
          4. accelerator-lowering-log1p.f64N/A

            \[\leadsto x \cdot e^{a \cdot \left(\color{blue}{\mathsf{log1p}\left(\mathsf{neg}\left(z\right)\right)} - b\right)} \]
          5. neg-lowering-neg.f6472.2

            \[\leadsto x \cdot e^{a \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right)} \]
        5. Simplified72.2%

          \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
        6. Taylor expanded in z around 0

          \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + -1 \cdot \left(a \cdot z\right)}} \]
        7. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto x \cdot e^{-1 \cdot \left(a \cdot b\right) + \color{blue}{\left(-1 \cdot a\right) \cdot z}} \]
          2. +-commutativeN/A

            \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot z + -1 \cdot \left(a \cdot b\right)}} \]
          3. associate-*r*N/A

            \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot z + \color{blue}{\left(-1 \cdot a\right) \cdot b}} \]
          4. distribute-lft-outN/A

            \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
          5. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
          6. mul-1-negN/A

            \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(z + b\right)} \]
          7. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot \left(z + b\right)} \]
          8. +-lowering-+.f6472.2

            \[\leadsto x \cdot e^{\left(-a\right) \cdot \color{blue}{\left(z + b\right)}} \]
        8. Simplified72.2%

          \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(z + b\right)}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification77.2%

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

      Alternative 18: 72.4% accurate, 2.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot {z}^{y}\\ \mathbf{if}\;y \leq -2.2 \cdot 10^{+55}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 0.0015:\\ \;\;\;\;x \cdot e^{-a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (let* ((t_1 (* x (pow z y))))
         (if (<= y -2.2e+55) t_1 (if (<= y 0.0015) (* x (exp (- (* a b)))) t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = x * pow(z, y);
      	double tmp;
      	if (y <= -2.2e+55) {
      		tmp = t_1;
      	} else if (y <= 0.0015) {
      		tmp = x * exp(-(a * 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 = x * (z ** y)
          if (y <= (-2.2d+55)) then
              tmp = t_1
          else if (y <= 0.0015d0) then
              tmp = x * exp(-(a * 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 = x * Math.pow(z, y);
      	double tmp;
      	if (y <= -2.2e+55) {
      		tmp = t_1;
      	} else if (y <= 0.0015) {
      		tmp = x * Math.exp(-(a * b));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = x * math.pow(z, y)
      	tmp = 0
      	if y <= -2.2e+55:
      		tmp = t_1
      	elif y <= 0.0015:
      		tmp = x * math.exp(-(a * b))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(x * (z ^ y))
      	tmp = 0.0
      	if (y <= -2.2e+55)
      		tmp = t_1;
      	elseif (y <= 0.0015)
      		tmp = Float64(x * exp(Float64(-Float64(a * b))));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	t_1 = x * (z ^ y);
      	tmp = 0.0;
      	if (y <= -2.2e+55)
      		tmp = t_1;
      	elseif (y <= 0.0015)
      		tmp = x * exp(-(a * b));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+55], t$95$1, If[LessEqual[y, 0.0015], N[(x * N[Exp[(-N[(a * b), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := x \cdot {z}^{y}\\
      \mathbf{if}\;y \leq -2.2 \cdot 10^{+55}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 0.0015:\\
      \;\;\;\;x \cdot e^{-a \cdot b}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -2.2000000000000001e55 or 0.0015 < y

        1. Initial program 96.8%

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

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
          2. --lowering--.f64N/A

            \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(\log z - t\right)}} \]
          3. log-lowering-log.f6489.8

            \[\leadsto x \cdot e^{y \cdot \left(\color{blue}{\log z} - t\right)} \]
        5. Simplified89.8%

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
        6. Taylor expanded in t around 0

          \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
        7. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
          2. pow-lowering-pow.f6463.8

            \[\leadsto x \cdot \color{blue}{{z}^{y}} \]
        8. Simplified63.8%

          \[\leadsto \color{blue}{x \cdot {z}^{y}} \]

        if -2.2000000000000001e55 < y < 0.0015

        1. Initial program 95.5%

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

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

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          3. *-lowering-*.f6480.9

            \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
        5. Simplified80.9%

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

      Alternative 19: 58.9% accurate, 2.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot {z}^{y}\\ \mathbf{if}\;y \leq -5 \cdot 10^{+51}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), -a\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (let* ((t_1 (* x (pow z y))))
         (if (<= y -5e+51)
           t_1
           (if (<= y 2.3e-9) (* x (fma b (fma 0.5 (* b (* a a)) (- a)) 1.0)) t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = x * pow(z, y);
      	double tmp;
      	if (y <= -5e+51) {
      		tmp = t_1;
      	} else if (y <= 2.3e-9) {
      		tmp = x * fma(b, fma(0.5, (b * (a * a)), -a), 1.0);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(x * (z ^ y))
      	tmp = 0.0
      	if (y <= -5e+51)
      		tmp = t_1;
      	elseif (y <= 2.3e-9)
      		tmp = Float64(x * fma(b, fma(0.5, Float64(b * Float64(a * a)), Float64(-a)), 1.0));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5e+51], t$95$1, If[LessEqual[y, 2.3e-9], N[(x * N[(b * N[(0.5 * N[(b * N[(a * a), $MachinePrecision]), $MachinePrecision] + (-a)), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := x \cdot {z}^{y}\\
      \mathbf{if}\;y \leq -5 \cdot 10^{+51}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 2.3 \cdot 10^{-9}:\\
      \;\;\;\;x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), -a\right), 1\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -5e51 or 2.2999999999999999e-9 < y

        1. Initial program 96.9%

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

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
          2. --lowering--.f64N/A

            \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(\log z - t\right)}} \]
          3. log-lowering-log.f6487.9

            \[\leadsto x \cdot e^{y \cdot \left(\color{blue}{\log z} - t\right)} \]
        5. Simplified87.9%

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
        6. Taylor expanded in t around 0

          \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
        7. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{x \cdot {z}^{y}} \]
          2. pow-lowering-pow.f6462.9

            \[\leadsto x \cdot \color{blue}{{z}^{y}} \]
        8. Simplified62.9%

          \[\leadsto \color{blue}{x \cdot {z}^{y}} \]

        if -5e51 < y < 2.2999999999999999e-9

        1. Initial program 95.3%

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

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

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          2. neg-lowering-neg.f64N/A

            \[\leadsto x \cdot e^{\color{blue}{\mathsf{neg}\left(a \cdot b\right)}} \]
          3. *-lowering-*.f6480.9

            \[\leadsto x \cdot e^{-\color{blue}{a \cdot b}} \]
        5. Simplified80.9%

          \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
        6. Taylor expanded in b around 0

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

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

            \[\leadsto x \cdot \left(b \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + -1 \cdot a\right)} + 1\right) \]
          3. mul-1-negN/A

            \[\leadsto x \cdot \left(b \cdot \left(\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + \color{blue}{\left(\mathsf{neg}\left(a\right)\right)}\right) + 1\right) \]
          4. sub-negN/A

            \[\leadsto x \cdot \left(b \cdot \color{blue}{\left(\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) - a\right)} + 1\right) \]
          5. accelerator-lowering-fma.f64N/A

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(b, \frac{1}{2} \cdot \left({a}^{2} \cdot b\right) - a, 1\right)} \]
          6. sub-negN/A

            \[\leadsto x \cdot \mathsf{fma}\left(b, \color{blue}{\frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + \left(\mathsf{neg}\left(a\right)\right)}, 1\right) \]
          7. mul-1-negN/A

            \[\leadsto x \cdot \mathsf{fma}\left(b, \frac{1}{2} \cdot \left({a}^{2} \cdot b\right) + \color{blue}{-1 \cdot a}, 1\right) \]
          8. accelerator-lowering-fma.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {a}^{2} \cdot b, -1 \cdot a\right)}, 1\right) \]
          9. *-commutativeN/A

            \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{b \cdot {a}^{2}}, -1 \cdot a\right), 1\right) \]
          10. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, \color{blue}{b \cdot {a}^{2}}, -1 \cdot a\right), 1\right) \]
          11. unpow2N/A

            \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, b \cdot \color{blue}{\left(a \cdot a\right)}, -1 \cdot a\right), 1\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, b \cdot \color{blue}{\left(a \cdot a\right)}, -1 \cdot a\right), 1\right) \]
          13. mul-1-negN/A

            \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(\frac{1}{2}, b \cdot \left(a \cdot a\right), \color{blue}{\mathsf{neg}\left(a\right)}\right), 1\right) \]
          14. neg-lowering-neg.f6466.3

            \[\leadsto x \cdot \mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), \color{blue}{-a}\right), 1\right) \]
        8. Simplified66.3%

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b \cdot \left(a \cdot a\right), -a\right), 1\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 20: 19.2% accurate, 328.0× speedup?

      \[\begin{array}{l} \\ x \end{array} \]
      (FPCore (x y z t a b) :precision binary64 x)
      double code(double x, double y, double z, double t, double a, double b) {
      	return x;
      }
      
      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
      end function
      
      public static double code(double x, double y, double z, double t, double a, double b) {
      	return x;
      }
      
      def code(x, y, z, t, a, b):
      	return x
      
      function code(x, y, z, t, a, b)
      	return x
      end
      
      function tmp = code(x, y, z, t, a, b)
      	tmp = x;
      end
      
      code[x_, y_, z_, t_, a_, b_] := x
      
      \begin{array}{l}
      
      \\
      x
      \end{array}
      
      Derivation
      1. Initial program 96.1%

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

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
        2. --lowering--.f64N/A

          \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(\log z - t\right)}} \]
        3. log-lowering-log.f6471.2

          \[\leadsto x \cdot e^{y \cdot \left(\color{blue}{\log z} - t\right)} \]
      5. Simplified71.2%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
      6. Taylor expanded in y around 0

        \[\leadsto \color{blue}{x} \]
      7. Step-by-step derivation
        1. Simplified19.1%

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

        Reproduce

        ?
        herbie shell --seed 2024199 
        (FPCore (x y z t a b)
          :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
          :precision binary64
          (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))