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

Percentage Accurate: 96.4% → 99.4%
Time: 14.3s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 96.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 0.8× speedup?

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

\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Derivation
  1. Initial program 97.7%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Step-by-step derivation
    1. fma-def98.1%

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

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

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

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

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

Alternative 2: 85.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.75 \cdot 10^{+64} \lor \neg \left(b \leq 1.2 \cdot 10^{+82}\right):\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \mathsf{log1p}\left(-z\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= b -1.75e+64) (not (<= b 1.2e+82)))
   (* x (exp (* a (- b))))
   (* x (exp (+ (* y (- (log z) t)) (* a (log1p (- z))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -1.75e+64) || !(b <= 1.2e+82)) {
		tmp = x * exp((a * -b));
	} else {
		tmp = x * exp(((y * (log(z) - t)) + (a * log1p(-z))));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -1.75e+64) || !(b <= 1.2e+82)) {
		tmp = x * Math.exp((a * -b));
	} else {
		tmp = x * Math.exp(((y * (Math.log(z) - t)) + (a * Math.log1p(-z))));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (b <= -1.75e+64) or not (b <= 1.2e+82):
		tmp = x * math.exp((a * -b))
	else:
		tmp = x * math.exp(((y * (math.log(z) - t)) + (a * math.log1p(-z))))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((b <= -1.75e+64) || !(b <= 1.2e+82))
		tmp = Float64(x * exp(Float64(a * Float64(-b))));
	else
		tmp = Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * log1p(Float64(-z))))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.75e+64], N[Not[LessEqual[b, 1.2e+82]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[Log[1 + (-z)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.75 \cdot 10^{+64} \lor \neg \left(b \leq 1.2 \cdot 10^{+82}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \mathsf{log1p}\left(-z\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.7499999999999999e64 or 1.19999999999999999e82 < b

    1. Initial program 98.0%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out85.4%

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

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

    if -1.7499999999999999e64 < b < 1.19999999999999999e82

    1. Initial program 97.4%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{a \cdot \log \left(1 - z\right)}} \]
    3. Step-by-step derivation
      1. sub-neg86.8%

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \log \color{blue}{\left(1 + \left(-z\right)\right)}} \]
      2. neg-mul-186.8%

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \log \left(1 + \color{blue}{-1 \cdot z}\right)} \]
      3. log1p-def90.5%

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

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \mathsf{log1p}\left(\color{blue}{-z}\right)} \]
    4. Simplified90.5%

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{a \cdot \mathsf{log1p}\left(-z\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.75 \cdot 10^{+64} \lor \neg \left(b \leq 1.2 \cdot 10^{+82}\right):\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \mathsf{log1p}\left(-z\right)}\\ \end{array} \]

Alternative 3: 96.4% accurate, 1.0× speedup?

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

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

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Final simplification97.7%

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

Alternative 4: 87.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{-72} \lor \neg \left(y \leq 3.4 \cdot 10^{+15}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -8e-72) (not (<= y 3.4e+15)))
   (* x (exp (* y (- (log z) t))))
   (* x (exp (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -8e-72) || !(y <= 3.4e+15)) {
		tmp = x * exp((y * (log(z) - t)));
	} else {
		tmp = x * exp((a * (log1p(-z) - b)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -8e-72) || !(y <= 3.4e+15)) {
		tmp = x * Math.exp((y * (Math.log(z) - t)));
	} else {
		tmp = x * Math.exp((a * (Math.log1p(-z) - b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -8e-72) or not (y <= 3.4e+15):
		tmp = x * math.exp((y * (math.log(z) - t)))
	else:
		tmp = x * math.exp((a * (math.log1p(-z) - b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -8e-72) || !(y <= 3.4e+15))
		tmp = Float64(x * exp(Float64(y * Float64(log(z) - t))));
	else
		tmp = Float64(x * exp(Float64(a * Float64(log1p(Float64(-z)) - b))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8e-72], N[Not[LessEqual[y, 3.4e+15]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{-72} \lor \neg \left(y \leq 3.4 \cdot 10^{+15}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.9999999999999997e-72 or 3.4e15 < y

    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. Taylor expanded in y around inf 84.7%

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

    if -7.9999999999999997e-72 < y < 3.4e15

    1. Initial program 98.2%

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

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

        \[\leadsto x \cdot e^{a \cdot \color{blue}{\left(\log \left(1 - z\right) + \left(-b\right)\right)}} \]
      2. sub-neg83.4%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} + \left(-b\right)\right)} \]
      3. neg-mul-183.4%

        \[\leadsto x \cdot e^{a \cdot \left(\log \left(1 + \color{blue}{-1 \cdot z}\right) + \left(-b\right)\right)} \]
      4. log1p-def85.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{-72} \lor \neg \left(y \leq 3.4 \cdot 10^{+15}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\ \end{array} \]

Alternative 5: 86.9% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.55 \cdot 10^{-71} \lor \neg \left(y \leq 3.1 \cdot 10^{+22}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.5500000000000001e-71 or 3.1000000000000002e22 < y

    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. Taylor expanded in y around inf 84.7%

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

    if -2.5500000000000001e-71 < y < 3.1000000000000002e22

    1. Initial program 98.2%

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

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

        \[\leadsto x \cdot e^{a \cdot \color{blue}{\left(\log \left(1 - z\right) + \left(-b\right)\right)}} \]
      2. sub-neg83.4%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} + \left(-b\right)\right)} \]
      3. neg-mul-183.4%

        \[\leadsto x \cdot e^{a \cdot \left(\log \left(1 + \color{blue}{-1 \cdot z}\right) + \left(-b\right)\right)} \]
      4. log1p-def85.1%

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot z\right) + -1 \cdot \left(a \cdot b\right)}} \]
      2. associate-*r*85.1%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      5. neg-mul-185.1%

        \[\leadsto x \cdot e^{\color{blue}{\left(-a\right)} \cdot \left(z + b\right)} \]
    7. Simplified85.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.55 \cdot 10^{-71} \lor \neg \left(y \leq 3.1 \cdot 10^{+22}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \end{array} \]

Alternative 6: 73.3% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ t_2 := x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{if}\;t \leq -6.5 \cdot 10^{+114}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-230}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-60}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+128}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (exp (* (- a) (+ z b))))) (t_2 (* x (exp (* y (- t))))))
   (if (<= t -6.5e+114)
     t_2
     (if (<= t 8.5e-230)
       t_1
       (if (<= t 2.8e-60) (* x (pow z y)) (if (<= t 2.5e+128) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((-a * (z + b)));
	double t_2 = x * exp((y * -t));
	double tmp;
	if (t <= -6.5e+114) {
		tmp = t_2;
	} else if (t <= 8.5e-230) {
		tmp = t_1;
	} else if (t <= 2.8e-60) {
		tmp = x * pow(z, y);
	} else if (t <= 2.5e+128) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * exp((-a * (z + b)))
    t_2 = x * exp((y * -t))
    if (t <= (-6.5d+114)) then
        tmp = t_2
    else if (t <= 8.5d-230) then
        tmp = t_1
    else if (t <= 2.8d-60) then
        tmp = x * (z ** y)
    else if (t <= 2.5d+128) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * Math.exp((-a * (z + b)));
	double t_2 = x * Math.exp((y * -t));
	double tmp;
	if (t <= -6.5e+114) {
		tmp = t_2;
	} else if (t <= 8.5e-230) {
		tmp = t_1;
	} else if (t <= 2.8e-60) {
		tmp = x * Math.pow(z, y);
	} else if (t <= 2.5e+128) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((-a * (z + b)))
	t_2 = x * math.exp((y * -t))
	tmp = 0
	if t <= -6.5e+114:
		tmp = t_2
	elif t <= 8.5e-230:
		tmp = t_1
	elif t <= 2.8e-60:
		tmp = x * math.pow(z, y)
	elif t <= 2.5e+128:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(Float64(-a) * Float64(z + b))))
	t_2 = Float64(x * exp(Float64(y * Float64(-t))))
	tmp = 0.0
	if (t <= -6.5e+114)
		tmp = t_2;
	elseif (t <= 8.5e-230)
		tmp = t_1;
	elseif (t <= 2.8e-60)
		tmp = Float64(x * (z ^ y));
	elseif (t <= 2.5e+128)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * exp((-a * (z + b)));
	t_2 = x * exp((y * -t));
	tmp = 0.0;
	if (t <= -6.5e+114)
		tmp = t_2;
	elseif (t <= 8.5e-230)
		tmp = t_1;
	elseif (t <= 2.8e-60)
		tmp = x * (z ^ y);
	elseif (t <= 2.5e+128)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e+114], t$95$2, If[LessEqual[t, 8.5e-230], t$95$1, If[LessEqual[t, 2.8e-60], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+128], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
t_2 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+114}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 8.5 \cdot 10^{-230}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 2.8 \cdot 10^{-60}:\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{elif}\;t \leq 2.5 \cdot 10^{+128}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.5000000000000001e114 or 2.5e128 < t

    1. Initial program 98.8%

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

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    3. Step-by-step derivation
      1. mul-1-neg88.5%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative88.5%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified88.5%

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

    if -6.5000000000000001e114 < t < 8.4999999999999998e-230 or 2.8000000000000002e-60 < t < 2.5e128

    1. Initial program 96.7%

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
    3. Step-by-step derivation
      1. sub-neg73.9%

        \[\leadsto x \cdot e^{a \cdot \color{blue}{\left(\log \left(1 - z\right) + \left(-b\right)\right)}} \]
      2. sub-neg73.9%

        \[\leadsto x \cdot e^{a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} + \left(-b\right)\right)} \]
      3. neg-mul-173.9%

        \[\leadsto x \cdot e^{a \cdot \left(\log \left(1 + \color{blue}{-1 \cdot z}\right) + \left(-b\right)\right)} \]
      4. log1p-def75.8%

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot z\right) + -1 \cdot \left(a \cdot b\right)}} \]
      2. associate-*r*75.8%

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot a\right) \cdot \left(z + b\right)}} \]
      5. neg-mul-175.8%

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

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

    if 8.4999999999999998e-230 < t < 2.8000000000000002e-60

    1. Initial program 99.9%

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

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

      \[\leadsto x \cdot \color{blue}{{z}^{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{+114}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-230}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-60}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+128}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]

Alternative 7: 70.7% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{a \cdot \left(-b\right)}\\ t_2 := x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{if}\;t \leq -9.2 \cdot 10^{+117}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-231}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-61}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{+128}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (exp (* a (- b))))) (t_2 (* x (exp (* y (- t))))))
   (if (<= t -9.2e+117)
     t_2
     (if (<= t 9.5e-231)
       t_1
       (if (<= t 9.5e-61) (* x (pow z y)) (if (<= t 2.25e+128) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((a * -b));
	double t_2 = x * exp((y * -t));
	double tmp;
	if (t <= -9.2e+117) {
		tmp = t_2;
	} else if (t <= 9.5e-231) {
		tmp = t_1;
	} else if (t <= 9.5e-61) {
		tmp = x * pow(z, y);
	} else if (t <= 2.25e+128) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * exp((a * -b))
    t_2 = x * exp((y * -t))
    if (t <= (-9.2d+117)) then
        tmp = t_2
    else if (t <= 9.5d-231) then
        tmp = t_1
    else if (t <= 9.5d-61) then
        tmp = x * (z ** y)
    else if (t <= 2.25d+128) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * Math.exp((a * -b));
	double t_2 = x * Math.exp((y * -t));
	double tmp;
	if (t <= -9.2e+117) {
		tmp = t_2;
	} else if (t <= 9.5e-231) {
		tmp = t_1;
	} else if (t <= 9.5e-61) {
		tmp = x * Math.pow(z, y);
	} else if (t <= 2.25e+128) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((a * -b))
	t_2 = x * math.exp((y * -t))
	tmp = 0
	if t <= -9.2e+117:
		tmp = t_2
	elif t <= 9.5e-231:
		tmp = t_1
	elif t <= 9.5e-61:
		tmp = x * math.pow(z, y)
	elif t <= 2.25e+128:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(a * Float64(-b))))
	t_2 = Float64(x * exp(Float64(y * Float64(-t))))
	tmp = 0.0
	if (t <= -9.2e+117)
		tmp = t_2;
	elseif (t <= 9.5e-231)
		tmp = t_1;
	elseif (t <= 9.5e-61)
		tmp = Float64(x * (z ^ y));
	elseif (t <= 2.25e+128)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * exp((a * -b));
	t_2 = x * exp((y * -t));
	tmp = 0.0;
	if (t <= -9.2e+117)
		tmp = t_2;
	elseif (t <= 9.5e-231)
		tmp = t_1;
	elseif (t <= 9.5e-61)
		tmp = x * (z ^ y);
	elseif (t <= 2.25e+128)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.2e+117], t$95$2, If[LessEqual[t, 9.5e-231], t$95$1, If[LessEqual[t, 9.5e-61], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.25e+128], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(-b\right)}\\
t_2 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+117}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 9.5 \cdot 10^{-231}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 9.5 \cdot 10^{-61}:\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{elif}\;t \leq 2.25 \cdot 10^{+128}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.19999999999999951e117 or 2.2500000000000001e128 < t

    1. Initial program 98.8%

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

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    3. Step-by-step derivation
      1. mul-1-neg88.5%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative88.5%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified88.5%

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

    if -9.19999999999999951e117 < t < 9.4999999999999995e-231 or 9.49999999999999986e-61 < t < 2.2500000000000001e128

    1. Initial program 96.7%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out72.6%

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

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

    if 9.4999999999999995e-231 < t < 9.49999999999999986e-61

    1. Initial program 99.9%

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

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

      \[\leadsto x \cdot \color{blue}{{z}^{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.2 \cdot 10^{+117}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-231}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-61}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{+128}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]

Alternative 8: 72.5% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.9 \cdot 10^{-13} \lor \neg \left(t \leq 5 \cdot 10^{-9}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= t -2.9e-13) (not (<= t 5e-9)))
   (* x (exp (* y (- t))))
   (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((t <= -2.9e-13) || !(t <= 5e-9)) {
		tmp = x * exp((y * -t));
	} else {
		tmp = x * pow(z, y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((t <= (-2.9d-13)) .or. (.not. (t <= 5d-9))) then
        tmp = x * exp((y * -t))
    else
        tmp = x * (z ** y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((t <= -2.9e-13) || !(t <= 5e-9)) {
		tmp = x * Math.exp((y * -t));
	} else {
		tmp = x * Math.pow(z, y);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (t <= -2.9e-13) or not (t <= 5e-9):
		tmp = x * math.exp((y * -t))
	else:
		tmp = x * math.pow(z, y)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((t <= -2.9e-13) || !(t <= 5e-9))
		tmp = Float64(x * exp(Float64(y * Float64(-t))));
	else
		tmp = Float64(x * (z ^ y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((t <= -2.9e-13) || ~((t <= 5e-9)))
		tmp = x * exp((y * -t));
	else
		tmp = x * (z ^ y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.9e-13], N[Not[LessEqual[t, 5e-9]], $MachinePrecision]], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{-13} \lor \neg \left(t \leq 5 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\

\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.8999999999999998e-13 or 5.0000000000000001e-9 < t

    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. Taylor expanded in t around inf 77.1%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
    3. Step-by-step derivation
      1. mul-1-neg77.1%

        \[\leadsto x \cdot e^{\color{blue}{-t \cdot y}} \]
      2. *-commutative77.1%

        \[\leadsto x \cdot e^{-\color{blue}{y \cdot t}} \]
    4. Simplified77.1%

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

    if -2.8999999999999998e-13 < t < 5.0000000000000001e-9

    1. Initial program 98.2%

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

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

      \[\leadsto x \cdot \color{blue}{{z}^{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.9 \cdot 10^{-13} \lor \neg \left(t \leq 5 \cdot 10^{-9}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 9: 54.1% accurate, 3.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+116}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.00000000000000012e116

    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. Taylor expanded in b around inf 31.9%

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out31.9%

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot b\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg14.3%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot b\right)}\right) \]
      2. unsub-neg14.3%

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

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    8. Taylor expanded in a around inf 22.9%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg22.9%

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. associate-*r*25.0%

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

        \[\leadsto -\color{blue}{x \cdot \left(a \cdot b\right)} \]
      4. distribute-lft-neg-in25.0%

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

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

    if -8.00000000000000012e116 < t

    1. Initial program 97.2%

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

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

      \[\leadsto x \cdot \color{blue}{{z}^{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8 \cdot 10^{+116}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 10: 27.0% accurate, 31.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.00055 \lor \neg \left(y \leq 1.9 \cdot 10^{-119}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -0.00055) (not (<= y 1.9e-119))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -0.00055) || !(y <= 1.9e-119)) {
		tmp = a * (x * -b);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((y <= (-0.00055d0)) .or. (.not. (y <= 1.9d-119))) then
        tmp = a * (x * -b)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -0.00055) || !(y <= 1.9e-119)) {
		tmp = a * (x * -b);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -0.00055) or not (y <= 1.9e-119):
		tmp = a * (x * -b)
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -0.00055) || !(y <= 1.9e-119))
		tmp = Float64(a * Float64(x * Float64(-b)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -0.00055) || ~((y <= 1.9e-119)))
		tmp = a * (x * -b);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.00055], N[Not[LessEqual[y, 1.9e-119]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00055 \lor \neg \left(y \leq 1.9 \cdot 10^{-119}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.50000000000000033e-4 or 1.89999999999999987e-119 < y

    1. Initial program 97.4%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out44.8%

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot b\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg12.7%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot b\right)}\right) \]
      2. unsub-neg12.7%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    7. Simplified12.7%

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    8. Taylor expanded in a around inf 24.1%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg24.1%

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. *-commutative24.1%

        \[\leadsto -a \cdot \color{blue}{\left(x \cdot b\right)} \]
      3. distribute-rgt-neg-in24.1%

        \[\leadsto \color{blue}{a \cdot \left(-x \cdot b\right)} \]
      4. distribute-rgt-neg-in24.1%

        \[\leadsto a \cdot \color{blue}{\left(x \cdot \left(-b\right)\right)} \]
    10. Simplified24.1%

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

    if -5.50000000000000033e-4 < y < 1.89999999999999987e-119

    1. Initial program 98.0%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out78.9%

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification27.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.00055 \lor \neg \left(y \leq 1.9 \cdot 10^{-119}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 11: 25.9% accurate, 31.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8.9 \cdot 10^{-48}:\\ \;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -8.9e-48)
   (* x (* z (- a)))
   (if (<= y 1.9e-119) x (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -8.9e-48) {
		tmp = x * (z * -a);
	} else if (y <= 1.9e-119) {
		tmp = x;
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= (-8.9d-48)) then
        tmp = x * (z * -a)
    else if (y <= 1.9d-119) then
        tmp = x
    else
        tmp = a * (x * -b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -8.9e-48) {
		tmp = x * (z * -a);
	} else if (y <= 1.9e-119) {
		tmp = x;
	} else {
		tmp = a * (x * -b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -8.9e-48:
		tmp = x * (z * -a)
	elif y <= 1.9e-119:
		tmp = x
	else:
		tmp = a * (x * -b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -8.9e-48)
		tmp = Float64(x * Float64(z * Float64(-a)));
	elseif (y <= 1.9e-119)
		tmp = x;
	else
		tmp = Float64(a * Float64(x * Float64(-b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -8.9e-48)
		tmp = x * (z * -a);
	elseif (y <= 1.9e-119)
		tmp = x;
	else
		tmp = a * (x * -b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8.9e-48], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-119], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.9 \cdot 10^{-48}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.90000000000000014e-48

    1. Initial program 97.5%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{a \cdot \log \left(1 - z\right)}} \]
    3. Step-by-step derivation
      1. sub-neg85.6%

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \log \color{blue}{\left(1 + \left(-z\right)\right)}} \]
      2. neg-mul-185.6%

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \log \left(1 + \color{blue}{-1 \cdot z}\right)} \]
      3. log1p-def86.8%

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

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \mathsf{log1p}\left(\color{blue}{-z}\right)} \]
    4. Simplified86.8%

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{a \cdot \mathsf{log1p}\left(-z\right)}} \]
    5. Taylor expanded in y around 0 6.1%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    6. Taylor expanded in z around 0 4.4%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg4.4%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot z\right)\right)} \]
      2. unsub-neg4.4%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot z\right)} \]
      3. *-commutative4.4%

        \[\leadsto x - \color{blue}{\left(x \cdot z\right) \cdot a} \]
      4. associate-*l*4.4%

        \[\leadsto x - \color{blue}{x \cdot \left(z \cdot a\right)} \]
      5. *-commutative4.4%

        \[\leadsto x - x \cdot \color{blue}{\left(a \cdot z\right)} \]
    8. Simplified4.4%

      \[\leadsto \color{blue}{x - x \cdot \left(a \cdot z\right)} \]
    9. Taylor expanded in a around inf 13.1%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg13.1%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. *-commutative13.1%

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot a} \]
      3. associate-*r*15.4%

        \[\leadsto -\color{blue}{x \cdot \left(z \cdot a\right)} \]
      4. distribute-rgt-neg-out15.4%

        \[\leadsto \color{blue}{x \cdot \left(-z \cdot a\right)} \]
      5. *-commutative15.4%

        \[\leadsto x \cdot \left(-\color{blue}{a \cdot z}\right) \]
      6. distribute-rgt-neg-in15.4%

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-z\right)\right)} \]
    11. Simplified15.4%

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

    if -8.90000000000000014e-48 < y < 1.89999999999999987e-119

    1. Initial program 97.8%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out83.7%

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

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

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

    if 1.89999999999999987e-119 < y

    1. Initial program 97.7%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out48.4%

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot b\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg17.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot b\right)}\right) \]
      2. unsub-neg17.8%

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

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    8. Taylor expanded in a around inf 31.1%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg31.1%

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. *-commutative31.1%

        \[\leadsto -a \cdot \color{blue}{\left(x \cdot b\right)} \]
      3. distribute-rgt-neg-in31.1%

        \[\leadsto \color{blue}{a \cdot \left(-x \cdot b\right)} \]
      4. distribute-rgt-neg-in31.1%

        \[\leadsto a \cdot \color{blue}{\left(x \cdot \left(-b\right)\right)} \]
    10. Simplified31.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.9 \cdot 10^{-48}:\\ \;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]

Alternative 12: 26.2% accurate, 31.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{-47}:\\ \;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -1.35e-47)
   (* x (* z (- a)))
   (if (<= y 1.9e-119) x (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.35e-47) {
		tmp = x * (z * -a);
	} else if (y <= 1.9e-119) {
		tmp = x;
	} else {
		tmp = x * (a * -b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y <= (-1.35d-47)) then
        tmp = x * (z * -a)
    else if (y <= 1.9d-119) then
        tmp = x
    else
        tmp = x * (a * -b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -1.35e-47) {
		tmp = x * (z * -a);
	} else if (y <= 1.9e-119) {
		tmp = x;
	} else {
		tmp = x * (a * -b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -1.35e-47:
		tmp = x * (z * -a)
	elif y <= 1.9e-119:
		tmp = x
	else:
		tmp = x * (a * -b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -1.35e-47)
		tmp = Float64(x * Float64(z * Float64(-a)));
	elseif (y <= 1.9e-119)
		tmp = x;
	else
		tmp = Float64(x * Float64(a * Float64(-b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -1.35e-47)
		tmp = x * (z * -a);
	elseif (y <= 1.9e-119)
		tmp = x;
	else
		tmp = x * (a * -b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.35e-47], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-119], x, N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-47}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.3499999999999999e-47

    1. Initial program 97.5%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{a \cdot \log \left(1 - z\right)}} \]
    3. Step-by-step derivation
      1. sub-neg85.6%

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \log \color{blue}{\left(1 + \left(-z\right)\right)}} \]
      2. neg-mul-185.6%

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \log \left(1 + \color{blue}{-1 \cdot z}\right)} \]
      3. log1p-def86.8%

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

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \mathsf{log1p}\left(\color{blue}{-z}\right)} \]
    4. Simplified86.8%

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{a \cdot \mathsf{log1p}\left(-z\right)}} \]
    5. Taylor expanded in y around 0 6.1%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    6. Taylor expanded in z around 0 4.4%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg4.4%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot z\right)\right)} \]
      2. unsub-neg4.4%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot z\right)} \]
      3. *-commutative4.4%

        \[\leadsto x - \color{blue}{\left(x \cdot z\right) \cdot a} \]
      4. associate-*l*4.4%

        \[\leadsto x - \color{blue}{x \cdot \left(z \cdot a\right)} \]
      5. *-commutative4.4%

        \[\leadsto x - x \cdot \color{blue}{\left(a \cdot z\right)} \]
    8. Simplified4.4%

      \[\leadsto \color{blue}{x - x \cdot \left(a \cdot z\right)} \]
    9. Taylor expanded in a around inf 13.1%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg13.1%

        \[\leadsto \color{blue}{-a \cdot \left(x \cdot z\right)} \]
      2. *-commutative13.1%

        \[\leadsto -\color{blue}{\left(x \cdot z\right) \cdot a} \]
      3. associate-*r*15.4%

        \[\leadsto -\color{blue}{x \cdot \left(z \cdot a\right)} \]
      4. distribute-rgt-neg-out15.4%

        \[\leadsto \color{blue}{x \cdot \left(-z \cdot a\right)} \]
      5. *-commutative15.4%

        \[\leadsto x \cdot \left(-\color{blue}{a \cdot z}\right) \]
      6. distribute-rgt-neg-in15.4%

        \[\leadsto x \cdot \color{blue}{\left(a \cdot \left(-z\right)\right)} \]
    11. Simplified15.4%

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

    if -1.3499999999999999e-47 < y < 1.89999999999999987e-119

    1. Initial program 97.8%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out83.7%

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

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

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

    if 1.89999999999999987e-119 < y

    1. Initial program 97.7%

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out48.4%

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot b\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg17.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot b\right)}\right) \]
      2. unsub-neg17.8%

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

      \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    8. Taylor expanded in a around inf 31.1%

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg31.1%

        \[\leadsto \color{blue}{-a \cdot \left(b \cdot x\right)} \]
      2. associate-*r*31.2%

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

        \[\leadsto -\color{blue}{x \cdot \left(a \cdot b\right)} \]
      4. distribute-lft-neg-in31.2%

        \[\leadsto \color{blue}{\left(-x\right) \cdot \left(a \cdot b\right)} \]
    10. Simplified31.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{-47}:\\ \;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-119}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \end{array} \]

Alternative 13: 24.8% accurate, 34.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.8 \cdot 10^{-45}:\\ \;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x 2.8e-45) (* a (* z (- x))) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= 2.8e-45) {
		tmp = a * (z * -x);
	} else {
		tmp = x * (1.0 - (a * b));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (x <= 2.8d-45) then
        tmp = a * (z * -x)
    else
        tmp = x * (1.0d0 - (a * b))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= 2.8e-45) {
		tmp = a * (z * -x);
	} else {
		tmp = x * (1.0 - (a * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= 2.8e-45:
		tmp = a * (z * -x)
	else:
		tmp = x * (1.0 - (a * b))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= 2.8e-45)
		tmp = Float64(a * Float64(z * Float64(-x)));
	else
		tmp = Float64(x * Float64(1.0 - Float64(a * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= 2.8e-45)
		tmp = a * (z * -x);
	else
		tmp = x * (1.0 - (a * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.8e-45], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8 \cdot 10^{-45}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.8000000000000001e-45

    1. Initial program 98.5%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{a \cdot \log \left(1 - z\right)}} \]
    3. Step-by-step derivation
      1. sub-neg70.3%

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \log \color{blue}{\left(1 + \left(-z\right)\right)}} \]
      2. neg-mul-170.3%

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \log \left(1 + \color{blue}{-1 \cdot z}\right)} \]
      3. log1p-def75.2%

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

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \mathsf{log1p}\left(\color{blue}{-z}\right)} \]
    4. Simplified75.2%

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{a \cdot \mathsf{log1p}\left(-z\right)}} \]
    5. Taylor expanded in y around 0 15.9%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    6. Taylor expanded in z around 0 13.2%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg13.2%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot z\right)\right)} \]
      2. unsub-neg13.2%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot z\right)} \]
      3. *-commutative13.2%

        \[\leadsto x - \color{blue}{\left(x \cdot z\right) \cdot a} \]
      4. associate-*l*13.2%

        \[\leadsto x - \color{blue}{x \cdot \left(z \cdot a\right)} \]
      5. *-commutative13.2%

        \[\leadsto x - x \cdot \color{blue}{\left(a \cdot z\right)} \]
    8. Simplified13.2%

      \[\leadsto \color{blue}{x - x \cdot \left(a \cdot z\right)} \]
    9. Taylor expanded in a around inf 21.2%

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

    if 2.8000000000000001e-45 < x

    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. Taylor expanded in b around inf 53.4%

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out53.4%

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(a \cdot b\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg34.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-a \cdot b\right)}\right) \]
      2. unsub-neg34.1%

        \[\leadsto x \cdot \color{blue}{\left(1 - a \cdot b\right)} \]
    7. Simplified34.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.8 \cdot 10^{-45}:\\ \;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \end{array} \]

Alternative 14: 25.0% accurate, 34.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 3.8 \cdot 10^{-45}:\\ \;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \left(x \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x 3.8e-45) (* a (* z (- x))) (- x (* a (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= 3.8e-45) {
		tmp = a * (z * -x);
	} else {
		tmp = x - (a * (x * b));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (x <= 3.8d-45) then
        tmp = a * (z * -x)
    else
        tmp = x - (a * (x * b))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= 3.8e-45) {
		tmp = a * (z * -x);
	} else {
		tmp = x - (a * (x * b));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= 3.8e-45:
		tmp = a * (z * -x)
	else:
		tmp = x - (a * (x * b))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= 3.8e-45)
		tmp = Float64(a * Float64(z * Float64(-x)));
	else
		tmp = Float64(x - Float64(a * Float64(x * b)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= 3.8e-45)
		tmp = a * (z * -x);
	else
		tmp = x - (a * (x * b));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 3.8e-45], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{-45}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 3.79999999999999997e-45

    1. Initial program 98.5%

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

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{a \cdot \log \left(1 - z\right)}} \]
    3. Step-by-step derivation
      1. sub-neg70.3%

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \log \color{blue}{\left(1 + \left(-z\right)\right)}} \]
      2. neg-mul-170.3%

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \log \left(1 + \color{blue}{-1 \cdot z}\right)} \]
      3. log1p-def75.2%

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

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \mathsf{log1p}\left(\color{blue}{-z}\right)} \]
    4. Simplified75.2%

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{a \cdot \mathsf{log1p}\left(-z\right)}} \]
    5. Taylor expanded in y around 0 15.9%

      \[\leadsto \color{blue}{x \cdot {\left(1 - z\right)}^{a}} \]
    6. Taylor expanded in z around 0 13.2%

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(x \cdot z\right)\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg13.2%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(x \cdot z\right)\right)} \]
      2. unsub-neg13.2%

        \[\leadsto \color{blue}{x - a \cdot \left(x \cdot z\right)} \]
      3. *-commutative13.2%

        \[\leadsto x - \color{blue}{\left(x \cdot z\right) \cdot a} \]
      4. associate-*l*13.2%

        \[\leadsto x - \color{blue}{x \cdot \left(z \cdot a\right)} \]
      5. *-commutative13.2%

        \[\leadsto x - x \cdot \color{blue}{\left(a \cdot z\right)} \]
    8. Simplified13.2%

      \[\leadsto \color{blue}{x - x \cdot \left(a \cdot z\right)} \]
    9. Taylor expanded in a around inf 21.2%

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

    if 3.79999999999999997e-45 < x

    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. Taylor expanded in b around inf 53.4%

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
      2. distribute-rgt-neg-out53.4%

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg32.5%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(b \cdot x\right)\right)} \]
      2. unsub-neg32.5%

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

        \[\leadsto x - a \cdot \color{blue}{\left(x \cdot b\right)} \]
    7. Simplified32.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.8 \cdot 10^{-45}:\\ \;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \left(x \cdot b\right)\\ \end{array} \]

Alternative 15: 20.0% accurate, 315.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x;
}
def code(x, y, z, t, a, b):
	return x
function code(x, y, z, t, a, b)
	return x
end
function tmp = code(x, y, z, t, a, b)
	tmp = x;
end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 97.7%

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

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

      \[\leadsto x \cdot e^{\color{blue}{-a \cdot b}} \]
    2. distribute-rgt-neg-out58.4%

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification15.7%

    \[\leadsto x \]

Reproduce

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