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

Percentage Accurate: 96.8% → 99.7%
Time: 14.6s
Alternatives: 9
Speedup: 1.5×

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 9 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 96.8% 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: 99.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ x \cdot e^{\mathsf{fma}\left(-a, b + z, \left(\log z - t\right) \cdot y\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (fma (- a) (+ b z) (* (- (log z) t) y)))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(fma(-a, (b + z), ((log(z) - t) * y)));
}
function code(x, y, z, t, a, b)
	return Float64(x * exp(fma(Float64(-a), Float64(b + z), Float64(Float64(log(z) - t) * y))))
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[((-a) * N[(b + z), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{\mathsf{fma}\left(-a, b + z, \left(\log z - t\right) \cdot y\right)}
\end{array}
Derivation
  1. Initial program 96.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 z around 0

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot e^{\mathsf{fma}\left(-a, b + z, \color{blue}{\left(\log z - t\right)} \cdot y\right)} \]
    12. lower-log.f6499.6

      \[\leadsto x \cdot e^{\mathsf{fma}\left(-a, b + z, \left(\color{blue}{\log z} - t\right) \cdot y\right)} \]
  5. Applied rewrites99.6%

    \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(-a, b + z, \left(\log z - t\right) \cdot y\right)}} \]
  6. Add Preprocessing

Alternative 2: 33.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \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.998:\\ \;\;\;\;\frac{\left(-t\right) \cdot \left(x \cdot y\right)}{1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, t \cdot \left(x \cdot y\right), x\right)}{1}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))) 0.998)
   (/ (* (- t) (* x y)) 1.0)
   (/ (fma -1.0 (* t (* x y)) x) 1.0)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))) <= 0.998) {
		tmp = (-t * (x * y)) / 1.0;
	} else {
		tmp = fma(-1.0, (t * (x * y)), x) / 1.0;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))) <= 0.998)
		tmp = Float64(Float64(Float64(-t) * Float64(x * y)) / 1.0);
	else
		tmp = Float64(fma(-1.0, Float64(t * Float64(x * y)), x) / 1.0);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[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], 0.998], N[(N[((-t) * N[(x * y), $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision], N[(N[(-1.0 * N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] / 1.0), $MachinePrecision]]
\begin{array}{l}

\\
\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.998:\\
\;\;\;\;\frac{\left(-t\right) \cdot \left(x \cdot y\right)}{1}\\

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


\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.998

    1. Initial program 96.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. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto x \cdot \color{blue}{e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
      3. sinh-+-cosh-revN/A

        \[\leadsto x \cdot \color{blue}{\left(\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) + \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)} \]
      4. flip-+N/A

        \[\leadsto x \cdot \color{blue}{\frac{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      5. sinh-coshN/A

        \[\leadsto x \cdot \frac{\color{blue}{1}}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
      6. sinh---cosh-revN/A

        \[\leadsto x \cdot \frac{1}{\color{blue}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
    4. Applied rewrites99.1%

      \[\leadsto \color{blue}{\frac{x \cdot 1}{e^{-\mathsf{fma}\left(\mathsf{log1p}\left(-z\right) - b, a, \left(\log z - t\right) \cdot y\right)}}} \]
    5. Taylor expanded in y around 0

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \left(y \cdot \left(t - \log z\right)\right), x\right)}}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      5. *-commutativeN/A

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

        \[\leadsto \frac{\mathsf{fma}\left(-1, \color{blue}{\left(y \cdot \left(t - \log z\right)\right) \cdot x}, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      7. *-commutativeN/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\color{blue}{\left(t - \log z\right)} \cdot y\right) \cdot x, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      10. lower-log.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \color{blue}{\log z}\right) \cdot y\right) \cdot x, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      11. mul-1-negN/A

        \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{e^{\color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}}} \]
      12. associate-*r*N/A

        \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(\log \left(1 - z\right) - b\right)}}} \]
      13. exp-prodN/A

        \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{\color{blue}{{\left(e^{-1 \cdot a}\right)}^{\left(\log \left(1 - z\right) - b\right)}}} \]
    7. Applied rewrites38.0%

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

      \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{1} \]
    9. Step-by-step derivation
      1. Applied rewrites3.0%

        \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{1} \]
      2. Taylor expanded in t around inf

        \[\leadsto \frac{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)}{1} \]
      3. Step-by-step derivation
        1. Applied rewrites19.3%

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

        if 0.998 < (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.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. Step-by-step derivation
          1. lift-*.f64N/A

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

            \[\leadsto x \cdot \color{blue}{e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
          3. sinh-+-cosh-revN/A

            \[\leadsto x \cdot \color{blue}{\left(\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) + \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)} \]
          4. flip-+N/A

            \[\leadsto x \cdot \color{blue}{\frac{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
          5. sinh-coshN/A

            \[\leadsto x \cdot \frac{\color{blue}{1}}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
          6. sinh---cosh-revN/A

            \[\leadsto x \cdot \frac{1}{\color{blue}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
        4. Applied rewrites99.9%

          \[\leadsto \color{blue}{\frac{x \cdot 1}{e^{-\mathsf{fma}\left(\mathsf{log1p}\left(-z\right) - b, a, \left(\log z - t\right) \cdot y\right)}}} \]
        5. Taylor expanded in y around 0

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

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

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

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

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \left(y \cdot \left(t - \log z\right)\right), x\right)}}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
          5. *-commutativeN/A

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

            \[\leadsto \frac{\mathsf{fma}\left(-1, \color{blue}{\left(y \cdot \left(t - \log z\right)\right) \cdot x}, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
          7. *-commutativeN/A

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

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

            \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\color{blue}{\left(t - \log z\right)} \cdot y\right) \cdot x, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
          10. lower-log.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \color{blue}{\log z}\right) \cdot y\right) \cdot x, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
          11. mul-1-negN/A

            \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{e^{\color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}}} \]
          12. associate-*r*N/A

            \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(\log \left(1 - z\right) - b\right)}}} \]
          13. exp-prodN/A

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

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

          \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{1} \]
        9. Step-by-step derivation
          1. Applied rewrites51.1%

            \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{1} \]
          2. Taylor expanded in t around inf

            \[\leadsto \frac{\mathsf{fma}\left(-1, t \cdot \left(x \cdot y\right), x\right)}{1} \]
          3. Step-by-step derivation
            1. Applied rewrites45.7%

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

            \[\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.998:\\ \;\;\;\;\frac{\left(-t\right) \cdot \left(x \cdot y\right)}{1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, t \cdot \left(x \cdot y\right), x\right)}{1}\\ \end{array} \]
          6. Add Preprocessing

          Alternative 3: 87.7% accurate, 1.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{+135} \lor \neg \left(t \leq 6.6 \cdot 10^{+139}\right):\\ \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)}\\ \end{array} \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (if (or (<= t -1.5e+135) (not (<= t 6.6e+139)))
             (* x (exp (* (- y) t)))
             (* x (exp (fma (- b) a (* (log z) y))))))
          double code(double x, double y, double z, double t, double a, double b) {
          	double tmp;
          	if ((t <= -1.5e+135) || !(t <= 6.6e+139)) {
          		tmp = x * exp((-y * t));
          	} else {
          		tmp = x * exp(fma(-b, a, (log(z) * y)));
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b)
          	tmp = 0.0
          	if ((t <= -1.5e+135) || !(t <= 6.6e+139))
          		tmp = Float64(x * exp(Float64(Float64(-y) * t)));
          	else
          		tmp = Float64(x * exp(fma(Float64(-b), a, Float64(log(z) * y))));
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.5e+135], N[Not[LessEqual[t, 6.6e+139]], $MachinePrecision]], N[(x * N[Exp[N[((-y) * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-b) * a + N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;t \leq -1.5 \cdot 10^{+135} \lor \neg \left(t \leq 6.6 \cdot 10^{+139}\right):\\
          \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\
          
          \mathbf{else}:\\
          \;\;\;\;x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -1.5e135 or 6.6000000000000003e139 < t

            1. Initial program 97.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 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-lft-neg-inN/A

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

                \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(y\right)\right) \cdot t}} \]
              5. lower-neg.f6488.8

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

              \[\leadsto x \cdot e^{\color{blue}{\left(-y\right) \cdot t}} \]

            if -1.5e135 < t < 6.6000000000000003e139

            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 z around 0

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

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

                \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(\color{blue}{b \cdot a}\right)\right) + y \cdot \left(\log z - t\right)} \]
              3. distribute-lft-neg-inN/A

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

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

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

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

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

                \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \color{blue}{\left(\log z - t\right)} \cdot y\right)} \]
              9. lower-log.f6496.4

                \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \left(\color{blue}{\log z} - t\right) \cdot y\right)} \]
            5. Applied rewrites96.4%

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

              \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, y \cdot \log z\right)} \]
            7. Step-by-step derivation
              1. Applied rewrites90.6%

                \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)} \]
            8. Recombined 2 regimes into one program.
            9. Final simplification90.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{+135} \lor \neg \left(t \leq 6.6 \cdot 10^{+139}\right):\\ \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)}\\ \end{array} \]
            10. Add Preprocessing

            Alternative 4: 84.3% accurate, 1.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8.6 \cdot 10^{-47} \lor \neg \left(y \leq 1.3 \cdot 10^{-61}\right):\\ \;\;\;\;e^{y \cdot \left(\log z - t\right)} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (if (or (<= y -8.6e-47) (not (<= y 1.3e-61)))
               (* (exp (* y (- (log z) t))) x)
               (* x (exp (* (- b) a)))))
            double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if ((y <= -8.6e-47) || !(y <= 1.3e-61)) {
            		tmp = exp((y * (log(z) - t))) * x;
            	} else {
            		tmp = x * exp((-b * a));
            	}
            	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 <= (-8.6d-47)) .or. (.not. (y <= 1.3d-61))) then
                    tmp = exp((y * (log(z) - t))) * x
                else
                    tmp = x * exp((-b * a))
                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 <= -8.6e-47) || !(y <= 1.3e-61)) {
            		tmp = Math.exp((y * (Math.log(z) - t))) * x;
            	} else {
            		tmp = x * Math.exp((-b * a));
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a, b):
            	tmp = 0
            	if (y <= -8.6e-47) or not (y <= 1.3e-61):
            		tmp = math.exp((y * (math.log(z) - t))) * x
            	else:
            		tmp = x * math.exp((-b * a))
            	return tmp
            
            function code(x, y, z, t, a, b)
            	tmp = 0.0
            	if ((y <= -8.6e-47) || !(y <= 1.3e-61))
            		tmp = Float64(exp(Float64(y * Float64(log(z) - t))) * x);
            	else
            		tmp = Float64(x * exp(Float64(Float64(-b) * a)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a, b)
            	tmp = 0.0;
            	if ((y <= -8.6e-47) || ~((y <= 1.3e-61)))
            		tmp = exp((y * (log(z) - t))) * x;
            	else
            		tmp = x * exp((-b * a));
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.6e-47], N[Not[LessEqual[y, 1.3e-61]], $MachinePrecision]], N[(N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -8.6 \cdot 10^{-47} \lor \neg \left(y \leq 1.3 \cdot 10^{-61}\right):\\
            \;\;\;\;e^{y \cdot \left(\log z - t\right)} \cdot x\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -8.5999999999999995e-47 or 1.30000000000000005e-61 < y

              1. Initial program 96.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. Step-by-step derivation
                1. lift-*.f64N/A

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

                  \[\leadsto x \cdot \color{blue}{e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                3. sinh-+-cosh-revN/A

                  \[\leadsto x \cdot \color{blue}{\left(\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) + \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)} \]
                4. flip-+N/A

                  \[\leadsto x \cdot \color{blue}{\frac{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                5. sinh-coshN/A

                  \[\leadsto x \cdot \frac{\color{blue}{1}}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                6. sinh---cosh-revN/A

                  \[\leadsto x \cdot \frac{1}{\color{blue}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
              4. Applied rewrites99.4%

                \[\leadsto \color{blue}{\frac{x \cdot 1}{e^{-\mathsf{fma}\left(\mathsf{log1p}\left(-z\right) - b, a, \left(\log z - t\right) \cdot y\right)}}} \]
              5. Taylor expanded in y around inf

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

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

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

                  \[\leadsto \frac{x \cdot 1}{e^{\color{blue}{\left(t - \log z\right)} \cdot y}} \]
                4. lower-log.f6483.6

                  \[\leadsto \frac{x \cdot 1}{e^{\left(t - \color{blue}{\log z}\right) \cdot y}} \]
              7. Applied rewrites83.6%

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

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

                  \[\leadsto \frac{\color{blue}{x \cdot 1}}{e^{\left(t - \log z\right) \cdot y}} \]
                3. associate-/l*N/A

                  \[\leadsto \color{blue}{x \cdot \frac{1}{e^{\left(t - \log z\right) \cdot y}}} \]
                4. lift-exp.f64N/A

                  \[\leadsto x \cdot \frac{1}{\color{blue}{e^{\left(t - \log z\right) \cdot y}}} \]
                5. rec-expN/A

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

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

                  \[\leadsto \color{blue}{e^{\mathsf{neg}\left(\left(t - \log z\right) \cdot y\right)} \cdot x} \]
              9. Applied rewrites83.6%

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

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

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

                  \[\leadsto e^{y \cdot \color{blue}{\left(\log z - t\right)}} \cdot x \]
                3. lower-log.f6483.6

                  \[\leadsto e^{y \cdot \left(\color{blue}{\log z} - t\right)} \cdot x \]
              12. Applied rewrites83.6%

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

              if -8.5999999999999995e-47 < y < 1.30000000000000005e-61

              1. Initial program 97.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. *-commutativeN/A

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

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

                  \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) \cdot a}} \]
                5. lower-neg.f6489.4

                  \[\leadsto x \cdot e^{\color{blue}{\left(-b\right)} \cdot a} \]
              5. Applied rewrites89.4%

                \[\leadsto x \cdot e^{\color{blue}{\left(-b\right) \cdot a}} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification85.9%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.6 \cdot 10^{-47} \lor \neg \left(y \leq 1.3 \cdot 10^{-61}\right):\\ \;\;\;\;e^{y \cdot \left(\log z - t\right)} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\ \end{array} \]
            5. Add Preprocessing

            Alternative 5: 96.6% accurate, 1.5× speedup?

            \[\begin{array}{l} \\ x \cdot e^{\mathsf{fma}\left(-b, a, \left(\log z - t\right) \cdot y\right)} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (* x (exp (fma (- b) a (* (- (log z) t) y)))))
            double code(double x, double y, double z, double t, double a, double b) {
            	return x * exp(fma(-b, a, ((log(z) - t) * y)));
            }
            
            function code(x, y, z, t, a, b)
            	return Float64(x * exp(fma(Float64(-b), a, Float64(Float64(log(z) - t) * y))))
            end
            
            code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[((-b) * a + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            x \cdot e^{\mathsf{fma}\left(-b, a, \left(\log z - t\right) \cdot y\right)}
            \end{array}
            
            Derivation
            1. Initial program 96.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 z around 0

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

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

                \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(\color{blue}{b \cdot a}\right)\right) + y \cdot \left(\log z - t\right)} \]
              3. distribute-lft-neg-inN/A

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

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

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

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

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

                \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \color{blue}{\left(\log z - t\right)} \cdot y\right)} \]
              9. lower-log.f6497.3

                \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \left(\color{blue}{\log z} - t\right) \cdot y\right)} \]
            5. Applied rewrites97.3%

              \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(-b, a, \left(\log z - t\right) \cdot y\right)}} \]
            6. Add Preprocessing

            Alternative 6: 70.6% accurate, 2.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{+138} \lor \neg \left(t \leq 9.2 \cdot 10^{-71}\right):\\ \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (if (or (<= t -1.25e+138) (not (<= t 9.2e-71)))
               (* x (exp (* (- y) t)))
               (* x (exp (* (- b) a)))))
            double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if ((t <= -1.25e+138) || !(t <= 9.2e-71)) {
            		tmp = x * exp((-y * t));
            	} else {
            		tmp = x * exp((-b * a));
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t, a, b)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8), intent (in) :: a
                real(8), intent (in) :: b
                real(8) :: tmp
                if ((t <= (-1.25d+138)) .or. (.not. (t <= 9.2d-71))) then
                    tmp = x * exp((-y * t))
                else
                    tmp = x * exp((-b * a))
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if ((t <= -1.25e+138) || !(t <= 9.2e-71)) {
            		tmp = x * Math.exp((-y * t));
            	} else {
            		tmp = x * Math.exp((-b * a));
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a, b):
            	tmp = 0
            	if (t <= -1.25e+138) or not (t <= 9.2e-71):
            		tmp = x * math.exp((-y * t))
            	else:
            		tmp = x * math.exp((-b * a))
            	return tmp
            
            function code(x, y, z, t, a, b)
            	tmp = 0.0
            	if ((t <= -1.25e+138) || !(t <= 9.2e-71))
            		tmp = Float64(x * exp(Float64(Float64(-y) * t)));
            	else
            		tmp = Float64(x * exp(Float64(Float64(-b) * a)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a, b)
            	tmp = 0.0;
            	if ((t <= -1.25e+138) || ~((t <= 9.2e-71)))
            		tmp = x * exp((-y * t));
            	else
            		tmp = x * exp((-b * a));
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.25e+138], N[Not[LessEqual[t, 9.2e-71]], $MachinePrecision]], N[(x * N[Exp[N[((-y) * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;t \leq -1.25 \cdot 10^{+138} \lor \neg \left(t \leq 9.2 \cdot 10^{-71}\right):\\
            \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if t < -1.25000000000000004e138 or 9.1999999999999994e-71 < t

              1. Initial program 96.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-lft-neg-inN/A

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

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

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

                \[\leadsto x \cdot e^{\color{blue}{\left(-y\right) \cdot t}} \]

              if -1.25000000000000004e138 < t < 9.1999999999999994e-71

              1. Initial program 96.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. *-commutativeN/A

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

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

                  \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) \cdot a}} \]
                5. lower-neg.f6469.5

                  \[\leadsto x \cdot e^{\color{blue}{\left(-b\right)} \cdot a} \]
              5. Applied rewrites69.5%

                \[\leadsto x \cdot e^{\color{blue}{\left(-b\right) \cdot a}} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification75.3%

              \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{+138} \lor \neg \left(t \leq 9.2 \cdot 10^{-71}\right):\\ \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\ \end{array} \]
            5. Add Preprocessing

            Alternative 7: 35.1% accurate, 2.8× speedup?

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

              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. Step-by-step derivation
                1. lift-*.f64N/A

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

                  \[\leadsto x \cdot \color{blue}{e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                3. sinh-+-cosh-revN/A

                  \[\leadsto x \cdot \color{blue}{\left(\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) + \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)} \]
                4. flip-+N/A

                  \[\leadsto x \cdot \color{blue}{\frac{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                5. sinh-coshN/A

                  \[\leadsto x \cdot \frac{\color{blue}{1}}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                6. sinh---cosh-revN/A

                  \[\leadsto x \cdot \frac{1}{\color{blue}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
              4. Applied rewrites100.0%

                \[\leadsto \color{blue}{\frac{x \cdot 1}{e^{-\mathsf{fma}\left(\mathsf{log1p}\left(-z\right) - b, a, \left(\log z - t\right) \cdot y\right)}}} \]
              5. Taylor expanded in y around 0

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

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

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

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

                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \left(y \cdot \left(t - \log z\right)\right), x\right)}}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                5. *-commutativeN/A

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

                  \[\leadsto \frac{\mathsf{fma}\left(-1, \color{blue}{\left(y \cdot \left(t - \log z\right)\right) \cdot x}, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                7. *-commutativeN/A

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

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

                  \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\color{blue}{\left(t - \log z\right)} \cdot y\right) \cdot x, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                10. lower-log.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \color{blue}{\log z}\right) \cdot y\right) \cdot x, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                11. mul-1-negN/A

                  \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{e^{\color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}}} \]
                12. associate-*r*N/A

                  \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(\log \left(1 - z\right) - b\right)}}} \]
                13. exp-prodN/A

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

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

                \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{1} \]
              9. Step-by-step derivation
                1. Applied rewrites34.1%

                  \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{1} \]
                2. Taylor expanded in t around inf

                  \[\leadsto \frac{\mathsf{fma}\left(-1, t \cdot \left(x \cdot y\right), x\right)}{1} \]
                3. Step-by-step derivation
                  1. Applied rewrites27.9%

                    \[\leadsto \frac{\mathsf{fma}\left(-1, t \cdot \left(x \cdot y\right), x\right)}{1} \]

                  if -4.79999999999999999e64 < y

                  1. Initial program 96.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 z around 0

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto x \cdot e^{\mathsf{fma}\left(-a, b + z, \color{blue}{\left(\log z - t\right)} \cdot y\right)} \]
                    12. lower-log.f6499.5

                      \[\leadsto x \cdot e^{\mathsf{fma}\left(-a, b + z, \left(\color{blue}{\log z} - t\right) \cdot y\right)} \]
                  5. Applied rewrites99.5%

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

                    \[\leadsto x \cdot e^{-1 \cdot \color{blue}{\left(a \cdot z\right)}} \]
                  7. Step-by-step derivation
                    1. Applied rewrites41.8%

                      \[\leadsto x \cdot e^{\left(-z\right) \cdot \color{blue}{a}} \]
                  8. Recombined 2 regimes into one program.
                  9. Add Preprocessing

                  Alternative 8: 59.3% accurate, 2.9× speedup?

                  \[\begin{array}{l} \\ x \cdot e^{\left(-b\right) \cdot a} \end{array} \]
                  (FPCore (x y z t a b) :precision binary64 (* x (exp (* (- b) a))))
                  double code(double x, double y, double z, double t, double a, double b) {
                  	return x * exp((-b * a));
                  }
                  
                  real(8) function code(x, y, z, t, a, b)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8), intent (in) :: a
                      real(8), intent (in) :: b
                      code = x * exp((-b * a))
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a, double b) {
                  	return x * Math.exp((-b * a));
                  }
                  
                  def code(x, y, z, t, a, b):
                  	return x * math.exp((-b * a))
                  
                  function code(x, y, z, t, a, b)
                  	return Float64(x * exp(Float64(Float64(-b) * a)))
                  end
                  
                  function tmp = code(x, y, z, t, a, b)
                  	tmp = x * exp((-b * a));
                  end
                  
                  code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  x \cdot e^{\left(-b\right) \cdot a}
                  \end{array}
                  
                  Derivation
                  1. Initial program 96.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. *-commutativeN/A

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

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

                      \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) \cdot a}} \]
                    5. lower-neg.f6460.8

                      \[\leadsto x \cdot e^{\color{blue}{\left(-b\right)} \cdot a} \]
                  5. Applied rewrites60.8%

                    \[\leadsto x \cdot e^{\color{blue}{\left(-b\right) \cdot a}} \]
                  6. Add Preprocessing

                  Alternative 9: 17.6% accurate, 13.7× speedup?

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

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

                      \[\leadsto x \cdot \color{blue}{e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                    3. sinh-+-cosh-revN/A

                      \[\leadsto x \cdot \color{blue}{\left(\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) + \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)} \]
                    4. flip-+N/A

                      \[\leadsto x \cdot \color{blue}{\frac{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                    5. sinh-coshN/A

                      \[\leadsto x \cdot \frac{\color{blue}{1}}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                    6. sinh---cosh-revN/A

                      \[\leadsto x \cdot \frac{1}{\color{blue}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
                  4. Applied rewrites99.6%

                    \[\leadsto \color{blue}{\frac{x \cdot 1}{e^{-\mathsf{fma}\left(\mathsf{log1p}\left(-z\right) - b, a, \left(\log z - t\right) \cdot y\right)}}} \]
                  5. Taylor expanded in y around 0

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

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

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

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

                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-1, x \cdot \left(y \cdot \left(t - \log z\right)\right), x\right)}}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                    5. *-commutativeN/A

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

                      \[\leadsto \frac{\mathsf{fma}\left(-1, \color{blue}{\left(y \cdot \left(t - \log z\right)\right) \cdot x}, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                    7. *-commutativeN/A

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

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

                      \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\color{blue}{\left(t - \log z\right)} \cdot y\right) \cdot x, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                    10. lower-log.f64N/A

                      \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \color{blue}{\log z}\right) \cdot y\right) \cdot x, x\right)}{e^{\mathsf{neg}\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                    11. mul-1-negN/A

                      \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{e^{\color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}}} \]
                    12. associate-*r*N/A

                      \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(\log \left(1 - z\right) - b\right)}}} \]
                    13. exp-prodN/A

                      \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{\color{blue}{{\left(e^{-1 \cdot a}\right)}^{\left(\log \left(1 - z\right) - b\right)}}} \]
                  7. Applied rewrites54.3%

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

                    \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{1} \]
                  9. Step-by-step derivation
                    1. Applied rewrites32.1%

                      \[\leadsto \frac{\mathsf{fma}\left(-1, \left(\left(t - \log z\right) \cdot y\right) \cdot x, x\right)}{1} \]
                    2. Taylor expanded in t around inf

                      \[\leadsto \frac{-1 \cdot \left(t \cdot \left(x \cdot y\right)\right)}{1} \]
                    3. Step-by-step derivation
                      1. Applied rewrites16.5%

                        \[\leadsto \frac{-t \cdot \left(x \cdot y\right)}{1} \]
                      2. Final simplification16.5%

                        \[\leadsto \frac{\left(-t\right) \cdot \left(x \cdot y\right)}{1} \]
                      3. Add Preprocessing

                      Reproduce

                      ?
                      herbie shell --seed 2024320 
                      (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))))))