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

Percentage Accurate: 96.5% → 96.5%
Time: 10.4s
Alternatives: 10
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 10 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.5% 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.5% accurate, 1.0× speedup?

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

\\
e^{\left(\log \left(1 - z\right) - b\right) \cdot a - \left(t - \log z\right) \cdot y} \cdot x
\end{array}
Derivation
  1. Initial program 97.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. Final simplification97.3%

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

Alternative 2: 87.4% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_1 := e^{\left(-y\right) \cdot \frac{t \cdot t}{t}} \cdot x\\
\mathbf{if}\;t \leq -265000000:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.65e8 or 6.99999999999999955e253 < t

    1. Initial program 97.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 t around inf

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

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
    6. Step-by-step derivation
      1. Applied rewrites86.7%

        \[\leadsto x \cdot e^{\frac{-t \cdot t}{t} \cdot y} \]

      if -2.65e8 < t < 6.99999999999999955e253

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

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

        \[\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, \log z \cdot y\right)} \]
      7. Step-by-step derivation
        1. Applied rewrites95.0%

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

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

      Alternative 3: 86.2% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := e^{\left(\log z - t\right) \cdot y} \cdot x\\ \mathbf{if}\;y \leq -0.07:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-9}:\\ \;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (let* ((t_1 (* (exp (* (- (log z) t) y)) x)))
         (if (<= y -0.07) t_1 (if (<= y 1.7e-9) (* (exp (* (- (- z) b) a)) x) t_1))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double t_1 = exp(((log(z) - t) * y)) * x;
      	double tmp;
      	if (y <= -0.07) {
      		tmp = t_1;
      	} else if (y <= 1.7e-9) {
      		tmp = exp(((-z - b) * a)) * 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) :: tmp
          t_1 = exp(((log(z) - t) * y)) * x
          if (y <= (-0.07d0)) then
              tmp = t_1
          else if (y <= 1.7d-9) then
              tmp = exp(((-z - b) * a)) * 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 = Math.exp(((Math.log(z) - t) * y)) * x;
      	double tmp;
      	if (y <= -0.07) {
      		tmp = t_1;
      	} else if (y <= 1.7e-9) {
      		tmp = Math.exp(((-z - b) * a)) * x;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a, b):
      	t_1 = math.exp(((math.log(z) - t) * y)) * x
      	tmp = 0
      	if y <= -0.07:
      		tmp = t_1
      	elif y <= 1.7e-9:
      		tmp = math.exp(((-z - b) * a)) * x
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t, a, b)
      	t_1 = Float64(exp(Float64(Float64(log(z) - t) * y)) * x)
      	tmp = 0.0
      	if (y <= -0.07)
      		tmp = t_1;
      	elseif (y <= 1.7e-9)
      		tmp = Float64(exp(Float64(Float64(Float64(-z) - b) * a)) * x);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a, b)
      	t_1 = exp(((log(z) - t) * y)) * x;
      	tmp = 0.0;
      	if (y <= -0.07)
      		tmp = t_1;
      	elseif (y <= 1.7e-9)
      		tmp = exp(((-z - b) * a)) * x;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -0.07], t$95$1, If[LessEqual[y, 1.7e-9], N[(N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := e^{\left(\log z - t\right) \cdot y} \cdot x\\
      \mathbf{if}\;y \leq -0.07:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 1.7 \cdot 10^{-9}:\\
      \;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -0.070000000000000007 or 1.6999999999999999e-9 < y

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x \cdot e^{\left(-z\right) \cdot a} \]
            2. Taylor expanded in y around inf

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

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

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

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

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

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

            if -0.070000000000000007 < y < 1.6999999999999999e-9

            1. Initial program 95.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 0

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

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

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

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

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

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

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

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

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

                \[\leadsto x \cdot e^{\left(\left(-z\right) - b\right) \cdot a} \]
            8. Recombined 2 regimes into one program.
            9. Final simplification91.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.07:\\ \;\;\;\;e^{\left(\log z - t\right) \cdot y} \cdot x\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-9}:\\ \;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\ \mathbf{else}:\\ \;\;\;\;e^{\left(\log z - t\right) \cdot y} \cdot x\\ \end{array} \]
            10. Add Preprocessing

            Alternative 4: 96.2% accurate, 1.5× speedup?

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

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

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

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

            Alternative 5: 71.3% accurate, 2.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.85 \cdot 10^{+110}:\\ \;\;\;\;e^{\left(-t\right) \cdot y} \cdot x\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-9}:\\ \;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\ \mathbf{else}:\\ \;\;\;\;e^{\left(-y\right) \cdot \frac{t \cdot t}{t}} \cdot x\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (if (<= y -2.85e+110)
               (* (exp (* (- t) y)) x)
               (if (<= y 2.7e-9)
                 (* (exp (* (- (- z) b) a)) x)
                 (* (exp (* (- y) (/ (* t t) t))) x))))
            double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if (y <= -2.85e+110) {
            		tmp = exp((-t * y)) * x;
            	} else if (y <= 2.7e-9) {
            		tmp = exp(((-z - b) * a)) * x;
            	} else {
            		tmp = exp((-y * ((t * t) / t))) * x;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t, a, b)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8), intent (in) :: a
                real(8), intent (in) :: b
                real(8) :: tmp
                if (y <= (-2.85d+110)) then
                    tmp = exp((-t * y)) * x
                else if (y <= 2.7d-9) then
                    tmp = exp(((-z - b) * a)) * x
                else
                    tmp = exp((-y * ((t * t) / t))) * x
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if (y <= -2.85e+110) {
            		tmp = Math.exp((-t * y)) * x;
            	} else if (y <= 2.7e-9) {
            		tmp = Math.exp(((-z - b) * a)) * x;
            	} else {
            		tmp = Math.exp((-y * ((t * t) / t))) * x;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a, b):
            	tmp = 0
            	if y <= -2.85e+110:
            		tmp = math.exp((-t * y)) * x
            	elif y <= 2.7e-9:
            		tmp = math.exp(((-z - b) * a)) * x
            	else:
            		tmp = math.exp((-y * ((t * t) / t))) * x
            	return tmp
            
            function code(x, y, z, t, a, b)
            	tmp = 0.0
            	if (y <= -2.85e+110)
            		tmp = Float64(exp(Float64(Float64(-t) * y)) * x);
            	elseif (y <= 2.7e-9)
            		tmp = Float64(exp(Float64(Float64(Float64(-z) - b) * a)) * x);
            	else
            		tmp = Float64(exp(Float64(Float64(-y) * Float64(Float64(t * t) / t))) * x);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a, b)
            	tmp = 0.0;
            	if (y <= -2.85e+110)
            		tmp = exp((-t * y)) * x;
            	elseif (y <= 2.7e-9)
            		tmp = exp(((-z - b) * a)) * x;
            	else
            		tmp = exp((-y * ((t * t) / t))) * x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.85e+110], N[(N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 2.7e-9], N[(N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], N[(N[Exp[N[((-y) * N[(N[(t * t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -2.85 \cdot 10^{+110}:\\
            \;\;\;\;e^{\left(-t\right) \cdot y} \cdot x\\
            
            \mathbf{elif}\;y \leq 2.7 \cdot 10^{-9}:\\
            \;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
            
            \mathbf{else}:\\
            \;\;\;\;e^{\left(-y\right) \cdot \frac{t \cdot t}{t}} \cdot x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if y < -2.8500000000000001e110

              1. Initial program 97.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 t around inf

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

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

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

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

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

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

              if -2.8500000000000001e110 < y < 2.7000000000000002e-9

              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 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. *-commutativeN/A

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

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

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

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

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

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

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

                \[\leadsto x \cdot e^{\left(-1 \cdot z - b\right) \cdot a} \]
              7. Step-by-step derivation
                1. Applied rewrites86.0%

                  \[\leadsto x \cdot e^{\left(\left(-z\right) - b\right) \cdot a} \]

                if 2.7000000000000002e-9 < y

                1. Initial program 98.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 t around inf

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

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

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

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

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

                  \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
                6. Step-by-step derivation
                  1. Applied rewrites72.9%

                    \[\leadsto x \cdot e^{\frac{-t \cdot t}{t} \cdot y} \]
                7. Recombined 3 regimes into one program.
                8. Final simplification80.0%

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

                Alternative 6: 71.9% accurate, 2.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := e^{\left(-t\right) \cdot y} \cdot x\\ \mathbf{if}\;y \leq -2.85 \cdot 10^{+110}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-9}:\\ \;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                (FPCore (x y z t a b)
                 :precision binary64
                 (let* ((t_1 (* (exp (* (- t) y)) x)))
                   (if (<= y -2.85e+110)
                     t_1
                     (if (<= y 2.7e-9) (* (exp (* (- (- z) b) a)) x) t_1))))
                double code(double x, double y, double z, double t, double a, double b) {
                	double t_1 = exp((-t * y)) * x;
                	double tmp;
                	if (y <= -2.85e+110) {
                		tmp = t_1;
                	} else if (y <= 2.7e-9) {
                		tmp = exp(((-z - b) * a)) * 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) :: tmp
                    t_1 = exp((-t * y)) * x
                    if (y <= (-2.85d+110)) then
                        tmp = t_1
                    else if (y <= 2.7d-9) then
                        tmp = exp(((-z - b) * a)) * 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 = Math.exp((-t * y)) * x;
                	double tmp;
                	if (y <= -2.85e+110) {
                		tmp = t_1;
                	} else if (y <= 2.7e-9) {
                		tmp = Math.exp(((-z - b) * a)) * x;
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t, a, b):
                	t_1 = math.exp((-t * y)) * x
                	tmp = 0
                	if y <= -2.85e+110:
                		tmp = t_1
                	elif y <= 2.7e-9:
                		tmp = math.exp(((-z - b) * a)) * x
                	else:
                		tmp = t_1
                	return tmp
                
                function code(x, y, z, t, a, b)
                	t_1 = Float64(exp(Float64(Float64(-t) * y)) * x)
                	tmp = 0.0
                	if (y <= -2.85e+110)
                		tmp = t_1;
                	elseif (y <= 2.7e-9)
                		tmp = Float64(exp(Float64(Float64(Float64(-z) - b) * a)) * x);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t, a, b)
                	t_1 = exp((-t * y)) * x;
                	tmp = 0.0;
                	if (y <= -2.85e+110)
                		tmp = t_1;
                	elseif (y <= 2.7e-9)
                		tmp = exp(((-z - b) * a)) * x;
                	else
                		tmp = t_1;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -2.85e+110], t$95$1, If[LessEqual[y, 2.7e-9], N[(N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := e^{\left(-t\right) \cdot y} \cdot x\\
                \mathbf{if}\;y \leq -2.85 \cdot 10^{+110}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;y \leq 2.7 \cdot 10^{-9}:\\
                \;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -2.8500000000000001e110 or 2.7000000000000002e-9 < y

                  1. Initial program 98.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. associate-*r*N/A

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

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

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

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

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

                  if -2.8500000000000001e110 < y < 2.7000000000000002e-9

                  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 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. *-commutativeN/A

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

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

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

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

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

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

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

                    \[\leadsto x \cdot e^{\left(-1 \cdot z - b\right) \cdot a} \]
                  7. Step-by-step derivation
                    1. Applied rewrites86.0%

                      \[\leadsto x \cdot e^{\left(\left(-z\right) - b\right) \cdot a} \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification80.0%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.85 \cdot 10^{+110}:\\ \;\;\;\;e^{\left(-t\right) \cdot y} \cdot x\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-9}:\\ \;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a} \cdot x\\ \mathbf{else}:\\ \;\;\;\;e^{\left(-t\right) \cdot y} \cdot x\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 7: 70.7% accurate, 2.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := e^{\left(-b\right) \cdot a} \cdot x\\ \mathbf{if}\;b \leq -11500000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{+51}:\\ \;\;\;\;e^{\left(-t\right) \cdot y} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  (FPCore (x y z t a b)
                   :precision binary64
                   (let* ((t_1 (* (exp (* (- b) a)) x)))
                     (if (<= b -11500000000.0)
                       t_1
                       (if (<= b 3.2e+51) (* (exp (* (- t) y)) x) t_1))))
                  double code(double x, double y, double z, double t, double a, double b) {
                  	double t_1 = exp((-b * a)) * x;
                  	double tmp;
                  	if (b <= -11500000000.0) {
                  		tmp = t_1;
                  	} else if (b <= 3.2e+51) {
                  		tmp = exp((-t * y)) * 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) :: tmp
                      t_1 = exp((-b * a)) * x
                      if (b <= (-11500000000.0d0)) then
                          tmp = t_1
                      else if (b <= 3.2d+51) then
                          tmp = exp((-t * y)) * 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 = Math.exp((-b * a)) * x;
                  	double tmp;
                  	if (b <= -11500000000.0) {
                  		tmp = t_1;
                  	} else if (b <= 3.2e+51) {
                  		tmp = Math.exp((-t * y)) * x;
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t, a, b):
                  	t_1 = math.exp((-b * a)) * x
                  	tmp = 0
                  	if b <= -11500000000.0:
                  		tmp = t_1
                  	elif b <= 3.2e+51:
                  		tmp = math.exp((-t * y)) * x
                  	else:
                  		tmp = t_1
                  	return tmp
                  
                  function code(x, y, z, t, a, b)
                  	t_1 = Float64(exp(Float64(Float64(-b) * a)) * x)
                  	tmp = 0.0
                  	if (b <= -11500000000.0)
                  		tmp = t_1;
                  	elseif (b <= 3.2e+51)
                  		tmp = Float64(exp(Float64(Float64(-t) * y)) * x);
                  	else
                  		tmp = t_1;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t, a, b)
                  	t_1 = exp((-b * a)) * x;
                  	tmp = 0.0;
                  	if (b <= -11500000000.0)
                  		tmp = t_1;
                  	elseif (b <= 3.2e+51)
                  		tmp = exp((-t * y)) * x;
                  	else
                  		tmp = t_1;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -11500000000.0], t$95$1, If[LessEqual[b, 3.2e+51], N[(N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := e^{\left(-b\right) \cdot a} \cdot x\\
                  \mathbf{if}\;b \leq -11500000000:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;b \leq 3.2 \cdot 10^{+51}:\\
                  \;\;\;\;e^{\left(-t\right) \cdot y} \cdot x\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if b < -1.15e10 or 3.2000000000000002e51 < b

                    1. Initial program 99.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) + 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.f6499.2

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

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

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

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

                      if -1.15e10 < b < 3.2000000000000002e51

                      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 t around inf

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

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

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

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

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

                        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification77.8%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -11500000000:\\ \;\;\;\;e^{\left(-b\right) \cdot a} \cdot x\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{+51}:\\ \;\;\;\;e^{\left(-t\right) \cdot y} \cdot x\\ \mathbf{else}:\\ \;\;\;\;e^{\left(-b\right) \cdot a} \cdot x\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 8: 61.6% accurate, 2.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := e^{\left(-b\right) \cdot a} \cdot x\\ \mathbf{if}\;b \leq -5.1 \cdot 10^{-92}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-236}:\\ \;\;\;\;e^{\left(-z\right) \cdot a} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                    (FPCore (x y z t a b)
                     :precision binary64
                     (let* ((t_1 (* (exp (* (- b) a)) x)))
                       (if (<= b -5.1e-92) t_1 (if (<= b 5e-236) (* (exp (* (- z) a)) x) t_1))))
                    double code(double x, double y, double z, double t, double a, double b) {
                    	double t_1 = exp((-b * a)) * x;
                    	double tmp;
                    	if (b <= -5.1e-92) {
                    		tmp = t_1;
                    	} else if (b <= 5e-236) {
                    		tmp = exp((-z * a)) * 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) :: tmp
                        t_1 = exp((-b * a)) * x
                        if (b <= (-5.1d-92)) then
                            tmp = t_1
                        else if (b <= 5d-236) then
                            tmp = exp((-z * a)) * 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 = Math.exp((-b * a)) * x;
                    	double tmp;
                    	if (b <= -5.1e-92) {
                    		tmp = t_1;
                    	} else if (b <= 5e-236) {
                    		tmp = Math.exp((-z * a)) * x;
                    	} else {
                    		tmp = t_1;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t, a, b):
                    	t_1 = math.exp((-b * a)) * x
                    	tmp = 0
                    	if b <= -5.1e-92:
                    		tmp = t_1
                    	elif b <= 5e-236:
                    		tmp = math.exp((-z * a)) * x
                    	else:
                    		tmp = t_1
                    	return tmp
                    
                    function code(x, y, z, t, a, b)
                    	t_1 = Float64(exp(Float64(Float64(-b) * a)) * x)
                    	tmp = 0.0
                    	if (b <= -5.1e-92)
                    		tmp = t_1;
                    	elseif (b <= 5e-236)
                    		tmp = Float64(exp(Float64(Float64(-z) * a)) * x);
                    	else
                    		tmp = t_1;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t, a, b)
                    	t_1 = exp((-b * a)) * x;
                    	tmp = 0.0;
                    	if (b <= -5.1e-92)
                    		tmp = t_1;
                    	elseif (b <= 5e-236)
                    		tmp = exp((-z * a)) * x;
                    	else
                    		tmp = t_1;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -5.1e-92], t$95$1, If[LessEqual[b, 5e-236], N[(N[Exp[N[((-z) * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := e^{\left(-b\right) \cdot a} \cdot x\\
                    \mathbf{if}\;b \leq -5.1 \cdot 10^{-92}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;b \leq 5 \cdot 10^{-236}:\\
                    \;\;\;\;e^{\left(-z\right) \cdot a} \cdot x\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_1\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if b < -5.09999999999999972e-92 or 4.9999999999999998e-236 < b

                      1. Initial program 99.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 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.f6499.0

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

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

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

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

                        if -5.09999999999999972e-92 < b < 4.9999999999999998e-236

                        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 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto x \cdot e^{\left(-z\right) \cdot a} \]
                          4. Recombined 2 regimes into one program.
                          5. Final simplification64.1%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.1 \cdot 10^{-92}:\\ \;\;\;\;e^{\left(-b\right) \cdot a} \cdot x\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-236}:\\ \;\;\;\;e^{\left(-z\right) \cdot a} \cdot x\\ \mathbf{else}:\\ \;\;\;\;e^{\left(-b\right) \cdot a} \cdot x\\ \end{array} \]
                          6. Add Preprocessing

                          Alternative 9: 35.8% accurate, 2.8× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.16 \cdot 10^{-23}:\\ \;\;\;\;e^{b \cdot a} \cdot x\\ \mathbf{else}:\\ \;\;\;\;e^{\left(-z\right) \cdot a} \cdot x\\ \end{array} \end{array} \]
                          (FPCore (x y z t a b)
                           :precision binary64
                           (if (<= b -1.16e-23) (* (exp (* b a)) x) (* (exp (* (- z) a)) x)))
                          double code(double x, double y, double z, double t, double a, double b) {
                          	double tmp;
                          	if (b <= -1.16e-23) {
                          		tmp = exp((b * a)) * x;
                          	} else {
                          		tmp = exp((-z * a)) * x;
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(x, y, z, t, a, b)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8), intent (in) :: t
                              real(8), intent (in) :: a
                              real(8), intent (in) :: b
                              real(8) :: tmp
                              if (b <= (-1.16d-23)) then
                                  tmp = exp((b * a)) * x
                              else
                                  tmp = exp((-z * a)) * x
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z, double t, double a, double b) {
                          	double tmp;
                          	if (b <= -1.16e-23) {
                          		tmp = Math.exp((b * a)) * x;
                          	} else {
                          		tmp = Math.exp((-z * a)) * x;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a, b):
                          	tmp = 0
                          	if b <= -1.16e-23:
                          		tmp = math.exp((b * a)) * x
                          	else:
                          		tmp = math.exp((-z * a)) * x
                          	return tmp
                          
                          function code(x, y, z, t, a, b)
                          	tmp = 0.0
                          	if (b <= -1.16e-23)
                          		tmp = Float64(exp(Float64(b * a)) * x);
                          	else
                          		tmp = Float64(exp(Float64(Float64(-z) * a)) * x);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a, b)
                          	tmp = 0.0;
                          	if (b <= -1.16e-23)
                          		tmp = exp((b * a)) * x;
                          	else
                          		tmp = exp((-z * a)) * x;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.16e-23], N[(N[Exp[N[(b * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], N[(N[Exp[N[((-z) * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;b \leq -1.16 \cdot 10^{-23}:\\
                          \;\;\;\;e^{b \cdot a} \cdot x\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;e^{\left(-z\right) \cdot a} \cdot x\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if b < -1.1599999999999999e-23

                            1. Initial program 98.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 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.f6498.8

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

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

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

                                \[\leadsto x \cdot e^{\left(-b\right) \cdot \color{blue}{a}} \]
                              2. Step-by-step derivation
                                1. Applied rewrites76.0%

                                  \[\leadsto x \cdot e^{\frac{0 - b \cdot b}{0 + b} \cdot a} \]
                                2. Step-by-step derivation
                                  1. lift-*.f64N/A

                                    \[\leadsto \color{blue}{x \cdot e^{\frac{0 - b \cdot b}{0 + b} \cdot a}} \]
                                  2. *-commutativeN/A

                                    \[\leadsto \color{blue}{e^{\frac{0 - b \cdot b}{0 + b} \cdot a} \cdot x} \]
                                  3. lower-*.f6476.0

                                    \[\leadsto \color{blue}{e^{\frac{0 - b \cdot b}{0 + b} \cdot a} \cdot x} \]
                                3. Applied rewrites20.4%

                                  \[\leadsto \color{blue}{e^{b \cdot a} \cdot x} \]

                                if -1.1599999999999999e-23 < 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 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto x \cdot e^{\left(-z\right) \cdot a} \]
                                  4. Recombined 2 regimes into one program.
                                  5. Final simplification35.0%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.16 \cdot 10^{-23}:\\ \;\;\;\;e^{b \cdot a} \cdot x\\ \mathbf{else}:\\ \;\;\;\;e^{\left(-z\right) \cdot a} \cdot x\\ \end{array} \]
                                  6. Add Preprocessing

                                  Alternative 10: 26.8% accurate, 3.0× speedup?

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

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

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

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

                                      \[\leadsto x \cdot e^{\left(-b\right) \cdot \color{blue}{a}} \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites59.6%

                                        \[\leadsto x \cdot e^{\frac{0 - b \cdot b}{0 + b} \cdot a} \]
                                      2. Step-by-step derivation
                                        1. lift-*.f64N/A

                                          \[\leadsto \color{blue}{x \cdot e^{\frac{0 - b \cdot b}{0 + b} \cdot a}} \]
                                        2. *-commutativeN/A

                                          \[\leadsto \color{blue}{e^{\frac{0 - b \cdot b}{0 + b} \cdot a} \cdot x} \]
                                        3. lower-*.f6459.6

                                          \[\leadsto \color{blue}{e^{\frac{0 - b \cdot b}{0 + b} \cdot a} \cdot x} \]
                                      3. Applied rewrites26.6%

                                        \[\leadsto \color{blue}{e^{b \cdot a} \cdot x} \]
                                      4. Add Preprocessing

                                      Reproduce

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