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

Percentage Accurate: 96.3% → 96.3%
Time: 12.7s
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.3% 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.3% accurate, 1.0× speedup?

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

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

Alternative 2: 34.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(-t\right), x, x\right)\\

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


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

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{x \cdot \left(y \cdot \left(\log z - t\right)\right)} \]
    7. Step-by-step derivation
      1. Applied rewrites2.7%

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

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

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

            \[\leadsto \left(t \cdot x\right) \cdot \left(-y\right) \]

          if -500 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 2.0000000000000001e-83

          1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

            \[\leadsto x + \color{blue}{x \cdot \left(y \cdot \left(\log z - t\right)\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto -1 \cdot \left(t \cdot \color{blue}{\left(-1 \cdot \frac{x + x \cdot \left(y \cdot \log z\right)}{t} + x \cdot y\right)}\right) \]
                  3. Step-by-step derivation
                    1. Applied rewrites34.2%

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

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

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

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

                    Alternative 3: 33.9% accurate, 1.4× speedup?

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

                      1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

                        \[\leadsto x + \color{blue}{x \cdot \left(y \cdot \left(\log z - t\right)\right)} \]
                      7. Step-by-step derivation
                        1. Applied rewrites2.7%

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

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

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

                              \[\leadsto \left(t \cdot x\right) \cdot \left(-y\right) \]

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto x + \color{blue}{x \cdot \left(y \cdot \left(\log z - t\right)\right)} \]
                            7. Step-by-step derivation
                              1. Applied rewrites45.0%

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

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

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

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

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

                                Alternative 4: 86.3% accurate, 1.5× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{if}\;y \leq -5.2 \cdot 10^{+30}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 850000000000:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                (FPCore (x y z t a b)
                                 :precision binary64
                                 (let* ((t_1 (* x (exp (* y (- (log z) t))))))
                                   (if (<= y -5.2e+30)
                                     t_1
                                     (if (<= y 850000000000.0) (* x (exp (* a (- (- z) b)))) t_1))))
                                double code(double x, double y, double z, double t, double a, double b) {
                                	double t_1 = x * exp((y * (log(z) - t)));
                                	double tmp;
                                	if (y <= -5.2e+30) {
                                		tmp = t_1;
                                	} else if (y <= 850000000000.0) {
                                		tmp = x * exp((a * (-z - b)));
                                	} else {
                                		tmp = t_1;
                                	}
                                	return tmp;
                                }
                                
                                real(8) function code(x, y, z, t, a, b)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8), intent (in) :: t
                                    real(8), intent (in) :: a
                                    real(8), intent (in) :: b
                                    real(8) :: t_1
                                    real(8) :: tmp
                                    t_1 = x * exp((y * (log(z) - t)))
                                    if (y <= (-5.2d+30)) then
                                        tmp = t_1
                                    else if (y <= 850000000000.0d0) then
                                        tmp = x * exp((a * (-z - b)))
                                    else
                                        tmp = t_1
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double x, double y, double z, double t, double a, double b) {
                                	double t_1 = x * Math.exp((y * (Math.log(z) - t)));
                                	double tmp;
                                	if (y <= -5.2e+30) {
                                		tmp = t_1;
                                	} else if (y <= 850000000000.0) {
                                		tmp = x * Math.exp((a * (-z - b)));
                                	} else {
                                		tmp = t_1;
                                	}
                                	return tmp;
                                }
                                
                                def code(x, y, z, t, a, b):
                                	t_1 = x * math.exp((y * (math.log(z) - t)))
                                	tmp = 0
                                	if y <= -5.2e+30:
                                		tmp = t_1
                                	elif y <= 850000000000.0:
                                		tmp = x * math.exp((a * (-z - b)))
                                	else:
                                		tmp = t_1
                                	return tmp
                                
                                function code(x, y, z, t, a, b)
                                	t_1 = Float64(x * exp(Float64(y * Float64(log(z) - t))))
                                	tmp = 0.0
                                	if (y <= -5.2e+30)
                                		tmp = t_1;
                                	elseif (y <= 850000000000.0)
                                		tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b))));
                                	else
                                		tmp = t_1;
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(x, y, z, t, a, b)
                                	t_1 = x * exp((y * (log(z) - t)));
                                	tmp = 0.0;
                                	if (y <= -5.2e+30)
                                		tmp = t_1;
                                	elseif (y <= 850000000000.0)
                                		tmp = x * exp((a * (-z - b)));
                                	else
                                		tmp = t_1;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e+30], t$95$1, If[LessEqual[y, 850000000000.0], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_1 := x \cdot e^{y \cdot \left(\log z - t\right)}\\
                                \mathbf{if}\;y \leq -5.2 \cdot 10^{+30}:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{elif}\;y \leq 850000000000:\\
                                \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_1\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if y < -5.19999999999999977e30 or 8.5e11 < y

                                  1. Initial program 100.0%

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

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

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

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

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

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

                                  if -5.19999999999999977e30 < y < 8.5e11

                                  1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

                                  Alternative 5: 76.6% accurate, 1.5× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{y \cdot \log z}\\ \mathbf{if}\;y \leq -1.56 \cdot 10^{+27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+14}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                  (FPCore (x y z t a b)
                                   :precision binary64
                                   (let* ((t_1 (* x (exp (* y (log z))))))
                                     (if (<= y -1.56e+27)
                                       t_1
                                       (if (<= y 2.1e+14) (* x (exp (* a (- (- z) b)))) t_1))))
                                  double code(double x, double y, double z, double t, double a, double b) {
                                  	double t_1 = x * exp((y * log(z)));
                                  	double tmp;
                                  	if (y <= -1.56e+27) {
                                  		tmp = t_1;
                                  	} else if (y <= 2.1e+14) {
                                  		tmp = x * exp((a * (-z - b)));
                                  	} else {
                                  		tmp = t_1;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  real(8) function code(x, y, z, t, a, b)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      real(8), intent (in) :: z
                                      real(8), intent (in) :: t
                                      real(8), intent (in) :: a
                                      real(8), intent (in) :: b
                                      real(8) :: t_1
                                      real(8) :: tmp
                                      t_1 = x * exp((y * log(z)))
                                      if (y <= (-1.56d+27)) then
                                          tmp = t_1
                                      else if (y <= 2.1d+14) then
                                          tmp = x * exp((a * (-z - b)))
                                      else
                                          tmp = t_1
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double x, double y, double z, double t, double a, double b) {
                                  	double t_1 = x * Math.exp((y * Math.log(z)));
                                  	double tmp;
                                  	if (y <= -1.56e+27) {
                                  		tmp = t_1;
                                  	} else if (y <= 2.1e+14) {
                                  		tmp = x * Math.exp((a * (-z - b)));
                                  	} else {
                                  		tmp = t_1;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x, y, z, t, a, b):
                                  	t_1 = x * math.exp((y * math.log(z)))
                                  	tmp = 0
                                  	if y <= -1.56e+27:
                                  		tmp = t_1
                                  	elif y <= 2.1e+14:
                                  		tmp = x * math.exp((a * (-z - b)))
                                  	else:
                                  		tmp = t_1
                                  	return tmp
                                  
                                  function code(x, y, z, t, a, b)
                                  	t_1 = Float64(x * exp(Float64(y * log(z))))
                                  	tmp = 0.0
                                  	if (y <= -1.56e+27)
                                  		tmp = t_1;
                                  	elseif (y <= 2.1e+14)
                                  		tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b))));
                                  	else
                                  		tmp = t_1;
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x, y, z, t, a, b)
                                  	t_1 = x * exp((y * log(z)));
                                  	tmp = 0.0;
                                  	if (y <= -1.56e+27)
                                  		tmp = t_1;
                                  	elseif (y <= 2.1e+14)
                                  		tmp = x * exp((a * (-z - b)));
                                  	else
                                  		tmp = t_1;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.56e+27], t$95$1, If[LessEqual[y, 2.1e+14], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_1 := x \cdot e^{y \cdot \log z}\\
                                  \mathbf{if}\;y \leq -1.56 \cdot 10^{+27}:\\
                                  \;\;\;\;t\_1\\
                                  
                                  \mathbf{elif}\;y \leq 2.1 \cdot 10^{+14}:\\
                                  \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;t\_1\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if y < -1.56e27 or 2.1e14 < y

                                    1. Initial program 100.0%

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

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

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

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

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

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

                                      \[\leadsto x \cdot e^{y \cdot \color{blue}{\log z}} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites72.6%

                                        \[\leadsto x \cdot e^{y \cdot \color{blue}{\log z}} \]

                                      if -1.56e27 < y < 2.1e14

                                      1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.56 \cdot 10^{+27}:\\ \;\;\;\;x \cdot e^{y \cdot \log z}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+14}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \log z}\\ \end{array} \]
                                      10. Add Preprocessing

                                      Alternative 6: 72.6% accurate, 2.6× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{if}\;y \leq -1.55 \cdot 10^{+67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+101}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                      (FPCore (x y z t a b)
                                       :precision binary64
                                       (let* ((t_1 (* x (exp (* y (- t))))))
                                         (if (<= y -1.55e+67)
                                           t_1
                                           (if (<= y 8.5e+101) (* x (exp (* a (- (- z) b)))) t_1))))
                                      double code(double x, double y, double z, double t, double a, double b) {
                                      	double t_1 = x * exp((y * -t));
                                      	double tmp;
                                      	if (y <= -1.55e+67) {
                                      		tmp = t_1;
                                      	} else if (y <= 8.5e+101) {
                                      		tmp = x * exp((a * (-z - b)));
                                      	} else {
                                      		tmp = t_1;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      real(8) function code(x, y, z, t, a, b)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          real(8), intent (in) :: z
                                          real(8), intent (in) :: t
                                          real(8), intent (in) :: a
                                          real(8), intent (in) :: b
                                          real(8) :: t_1
                                          real(8) :: tmp
                                          t_1 = x * exp((y * -t))
                                          if (y <= (-1.55d+67)) then
                                              tmp = t_1
                                          else if (y <= 8.5d+101) then
                                              tmp = x * exp((a * (-z - b)))
                                          else
                                              tmp = t_1
                                          end if
                                          code = tmp
                                      end function
                                      
                                      public static double code(double x, double y, double z, double t, double a, double b) {
                                      	double t_1 = x * Math.exp((y * -t));
                                      	double tmp;
                                      	if (y <= -1.55e+67) {
                                      		tmp = t_1;
                                      	} else if (y <= 8.5e+101) {
                                      		tmp = x * Math.exp((a * (-z - b)));
                                      	} else {
                                      		tmp = t_1;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(x, y, z, t, a, b):
                                      	t_1 = x * math.exp((y * -t))
                                      	tmp = 0
                                      	if y <= -1.55e+67:
                                      		tmp = t_1
                                      	elif y <= 8.5e+101:
                                      		tmp = x * math.exp((a * (-z - b)))
                                      	else:
                                      		tmp = t_1
                                      	return tmp
                                      
                                      function code(x, y, z, t, a, b)
                                      	t_1 = Float64(x * exp(Float64(y * Float64(-t))))
                                      	tmp = 0.0
                                      	if (y <= -1.55e+67)
                                      		tmp = t_1;
                                      	elseif (y <= 8.5e+101)
                                      		tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b))));
                                      	else
                                      		tmp = t_1;
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(x, y, z, t, a, b)
                                      	t_1 = x * exp((y * -t));
                                      	tmp = 0.0;
                                      	if (y <= -1.55e+67)
                                      		tmp = t_1;
                                      	elseif (y <= 8.5e+101)
                                      		tmp = x * exp((a * (-z - b)));
                                      	else
                                      		tmp = t_1;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e+67], t$95$1, If[LessEqual[y, 8.5e+101], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_1 := x \cdot e^{y \cdot \left(-t\right)}\\
                                      \mathbf{if}\;y \leq -1.55 \cdot 10^{+67}:\\
                                      \;\;\;\;t\_1\\
                                      
                                      \mathbf{elif}\;y \leq 8.5 \cdot 10^{+101}:\\
                                      \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;t\_1\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if y < -1.54999999999999998e67 or 8.5000000000000001e101 < y

                                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

                                        if -1.54999999999999998e67 < y < 8.5000000000000001e101

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

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

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

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

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

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

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

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

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

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

                                        Alternative 7: 69.8% accurate, 2.6× speedup?

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

                                          1. Initial program 100.0%

                                            \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                          2. Add Preprocessing
                                          3. Taylor expanded in 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. lower-neg.f64N/A

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

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

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

                                          if -1.3000000000000001e103 < b < 2.6000000000000002e-29

                                          1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

                                        Alternative 8: 57.7% accurate, 2.9× speedup?

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

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

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

                                          \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
                                        6. Final simplification58.1%

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

                                        Alternative 9: 17.4% accurate, 25.2× speedup?

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

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

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

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

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

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

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

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

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

                                          \[\leadsto x + \color{blue}{x \cdot \left(y \cdot \left(\log z - t\right)\right)} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites28.8%

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

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

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

                                                \[\leadsto \left(t \cdot x\right) \cdot \left(-y\right) \]
                                              2. Final simplification19.1%

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

                                              Alternative 10: 16.8% accurate, 25.2× speedup?

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

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

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

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

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

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

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

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

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

                                                \[\leadsto x + \color{blue}{x \cdot \left(y \cdot \left(\log z - t\right)\right)} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites28.8%

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

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

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

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

                                                  Reproduce

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