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

Percentage Accurate: 96.5% → 99.6%
Time: 24.2s
Alternatives: 15
Speedup: 0.8×

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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

Alternative 2: 96.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5 \cdot 10^{+268}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -5e+268)
   (* x (exp (* a (- (- b) z))))
   (* 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) {
	double tmp;
	if (a <= -5e+268) {
		tmp = x * exp((a * (-b - z)));
	} else {
		tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - 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 (a <= (-5d+268)) then
        tmp = x * exp((a * (-b - z)))
    else
        tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - 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 (a <= -5e+268) {
		tmp = x * Math.exp((a * (-b - z)));
	} else {
		tmp = x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -5e+268:
		tmp = x * math.exp((a * (-b - z)))
	else:
		tmp = x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -5e+268)
		tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z))));
	else
		tmp = Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -5e+268)
		tmp = x * exp((a * (-b - z)));
	else
		tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5e+268], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+268}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.0000000000000002e268

    1. Initial program 17.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 34.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e268 < a

    1. Initial program 96.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.1%

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

Alternative 3: 86.9% accurate, 1.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.45e18 or 4.5 < y

    1. Initial program 95.7%

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

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

    if -1.45e18 < y < 4.5

    1. Initial program 92.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 0 77.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 72.5% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{+15} \lor \neg \left(a \leq 1.1 \cdot 10^{-105}\right):\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -1.9e+15) (not (<= a 1.1e-105)))
   (* x (exp (* a (- (- b) z))))
   (* x (exp (* y (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -1.9e+15) || !(a <= 1.1e-105)) {
		tmp = x * exp((a * (-b - z)));
	} else {
		tmp = x * exp((y * -t));
	}
	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 ((a <= (-1.9d+15)) .or. (.not. (a <= 1.1d-105))) then
        tmp = x * exp((a * (-b - z)))
    else
        tmp = x * exp((y * -t))
    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 ((a <= -1.9e+15) || !(a <= 1.1e-105)) {
		tmp = x * Math.exp((a * (-b - z)));
	} else {
		tmp = x * Math.exp((y * -t));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -1.9e+15) or not (a <= 1.1e-105):
		tmp = x * math.exp((a * (-b - z)))
	else:
		tmp = x * math.exp((y * -t))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -1.9e+15) || !(a <= 1.1e-105))
		tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z))));
	else
		tmp = Float64(x * exp(Float64(y * Float64(-t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((a <= -1.9e+15) || ~((a <= 1.1e-105)))
		tmp = x * exp((a * (-b - z)));
	else
		tmp = x * exp((y * -t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.9e+15], N[Not[LessEqual[a, 1.1e-105]], $MachinePrecision]], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+15} \lor \neg \left(a \leq 1.1 \cdot 10^{-105}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9e15 or 1.10000000000000002e-105 < a

    1. Initial program 90.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 67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9e15 < a < 1.10000000000000002e-105

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

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

        \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
      2. distribute-rgt-neg-out76.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{+15} \lor \neg \left(a \leq 1.1 \cdot 10^{-105}\right):\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]

Alternative 5: 73.9% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+24} \lor \neg \left(y \leq 0.7\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2e24 or 0.69999999999999996 < y

    1. Initial program 95.6%

      \[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 86.9%

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

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

    if -2e24 < y < 0.69999999999999996

    1. Initial program 93.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 74.7%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*74.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+24} \lor \neg \left(y \leq 0.7\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \]

Alternative 6: 72.2% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.4 \cdot 10^{+47} \lor \neg \left(t \leq 1.45 \cdot 10^{-74}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.39999999999999928e47 or 1.45e-74 < t

    1. Initial program 94.6%

      \[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 76.2%

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

        \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
      2. distribute-rgt-neg-out76.2%

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

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

    if -9.39999999999999928e47 < t < 1.45e-74

    1. Initial program 93.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 70.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*70.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.4 \cdot 10^{+47} \lor \neg \left(t \leq 1.45 \cdot 10^{-74}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \]

Alternative 7: 55.7% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{-67} \lor \neg \left(y \leq 3.05 \cdot 10^{-15}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \left(x \cdot \left(z + b\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -8.2e-67) (not (<= y 3.05e-15)))
   (* x (pow z y))
   (- x (* a (* x (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -8.2e-67) || !(y <= 3.05e-15)) {
		tmp = x * pow(z, y);
	} else {
		tmp = x - (a * (x * (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 <= (-8.2d-67)) .or. (.not. (y <= 3.05d-15))) then
        tmp = x * (z ** y)
    else
        tmp = x - (a * (x * (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 <= -8.2e-67) || !(y <= 3.05e-15)) {
		tmp = x * Math.pow(z, y);
	} else {
		tmp = x - (a * (x * (z + b)));
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -8.2e-67) or not (y <= 3.05e-15):
		tmp = x * math.pow(z, y)
	else:
		tmp = x - (a * (x * (z + b)))
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -8.2e-67) || !(y <= 3.05e-15))
		tmp = Float64(x * (z ^ y));
	else
		tmp = Float64(x - Float64(a * Float64(x * Float64(z + b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -8.2e-67) || ~((y <= 3.05e-15)))
		tmp = x * (z ^ y);
	else
		tmp = x - (a * (x * (z + b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.2e-67], N[Not[LessEqual[y, 3.05e-15]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(x * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-67} \lor \neg \left(y \leq 3.05 \cdot 10^{-15}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.1999999999999994e-67 or 3.04999999999999986e-15 < y

    1. Initial program 95.7%

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

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

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

    if -8.1999999999999994e-67 < y < 3.04999999999999986e-15

    1. Initial program 92.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 y around 0 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(\left(b + z\right) \cdot x\right)\right)} \]
      2. mul-1-neg41.6%

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(\left(b + z\right) \cdot x\right)\right)} \]
      3. unsub-neg41.6%

        \[\leadsto \color{blue}{x - a \cdot \left(\left(b + z\right) \cdot x\right)} \]
    10. Simplified41.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{-67} \lor \neg \left(y \leq 3.05 \cdot 10^{-15}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \left(x \cdot \left(z + b\right)\right)\\ \end{array} \]

Alternative 8: 25.9% accurate, 22.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.00034:\\ \;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-220}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-292} \lor \neg \left(y \leq 2.2 \cdot 10^{-17}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -0.00034)
   (* (- b) (* x a))
   (if (<= y -1.1e-220)
     x
     (if (or (<= y -7.2e-292) (not (<= y 2.2e-17))) (* a (* x (- z))) x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -0.00034) {
		tmp = -b * (x * a);
	} else if (y <= -1.1e-220) {
		tmp = x;
	} else if ((y <= -7.2e-292) || !(y <= 2.2e-17)) {
		tmp = a * (x * -z);
	} 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.00034d0)) then
        tmp = -b * (x * a)
    else if (y <= (-1.1d-220)) then
        tmp = x
    else if ((y <= (-7.2d-292)) .or. (.not. (y <= 2.2d-17))) then
        tmp = a * (x * -z)
    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.00034) {
		tmp = -b * (x * a);
	} else if (y <= -1.1e-220) {
		tmp = x;
	} else if ((y <= -7.2e-292) || !(y <= 2.2e-17)) {
		tmp = a * (x * -z);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -0.00034:
		tmp = -b * (x * a)
	elif y <= -1.1e-220:
		tmp = x
	elif (y <= -7.2e-292) or not (y <= 2.2e-17):
		tmp = a * (x * -z)
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -0.00034)
		tmp = Float64(Float64(-b) * Float64(x * a));
	elseif (y <= -1.1e-220)
		tmp = x;
	elseif ((y <= -7.2e-292) || !(y <= 2.2e-17))
		tmp = Float64(a * Float64(x * Float64(-z)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -0.00034)
		tmp = -b * (x * a);
	elseif (y <= -1.1e-220)
		tmp = x;
	elseif ((y <= -7.2e-292) || ~((y <= 2.2e-17)))
		tmp = a * (x * -z);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.00034], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.1e-220], x, If[Or[LessEqual[y, -7.2e-292], N[Not[LessEqual[y, 2.2e-17]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00034:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-220}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -7.2 \cdot 10^{-292} \lor \neg \left(y \leq 2.2 \cdot 10^{-17}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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


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

    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 b around inf 43.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*43.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4e-4 < y < -1.09999999999999993e-220 or -7.2000000000000004e-292 < y < 2.2e-17

    1. Initial program 93.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 75.5%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*75.5%

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

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

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

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

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

    if -1.09999999999999993e-220 < y < -7.2000000000000004e-292 or 2.2e-17 < y

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - a \cdot \left(\left(b + z\right) \cdot x\right)} \]
    10. Simplified12.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.00034:\\ \;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-220}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{-292} \lor \neg \left(y \leq 2.2 \cdot 10^{-17}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 9: 27.2% accurate, 28.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.00085:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-17}:\\ \;\;\;\;x + b \cdot \left(x \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -0.00085)
   (* x (* a (- b)))
   (if (<= y 8.2e-17) (+ x (* b (* x a))) (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -0.00085) {
		tmp = x * (a * -b);
	} else if (y <= 8.2e-17) {
		tmp = x + (b * (x * a));
	} else {
		tmp = a * (x * -z);
	}
	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.00085d0)) then
        tmp = x * (a * -b)
    else if (y <= 8.2d-17) then
        tmp = x + (b * (x * a))
    else
        tmp = a * (x * -z)
    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.00085) {
		tmp = x * (a * -b);
	} else if (y <= 8.2e-17) {
		tmp = x + (b * (x * a));
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -0.00085:
		tmp = x * (a * -b)
	elif y <= 8.2e-17:
		tmp = x + (b * (x * a))
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -0.00085)
		tmp = Float64(x * Float64(a * Float64(-b)));
	elseif (y <= 8.2e-17)
		tmp = Float64(x + Float64(b * Float64(x * a)));
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -0.00085)
		tmp = x * (a * -b);
	elseif (y <= 8.2e-17)
		tmp = x + (b * (x * a));
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.00085], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-17], N[(x + N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00085:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

\mathbf{elif}\;y \leq 8.2 \cdot 10^{-17}:\\
\;\;\;\;x + b \cdot \left(x \cdot a\right)\\

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


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

    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 b around inf 43.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*43.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    12. Step-by-step derivation
      1. associate-*r*13.2%

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

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

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

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

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

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

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

    if -8.49999999999999953e-4 < y < 8.2000000000000001e-17

    1. Initial program 93.1%

      \[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 75.3%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\color{blue}{a \cdot \left(b \cdot x\right)}\right) \]
      4. mul-1-neg35.6%

        \[\leadsto x + \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
      5. +-commutative35.6%

        \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right) + x} \]
      6. mul-1-neg35.6%

        \[\leadsto \color{blue}{\left(-a \cdot \left(b \cdot x\right)\right)} + x \]
      7. *-commutative35.6%

        \[\leadsto \left(-\color{blue}{\left(b \cdot x\right) \cdot a}\right) + x \]
      8. distribute-rgt-neg-in35.6%

        \[\leadsto \color{blue}{\left(b \cdot x\right) \cdot \left(-a\right)} + x \]
      9. add-sqr-sqrt17.2%

        \[\leadsto \left(b \cdot x\right) \cdot \color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} + x \]
      10. sqrt-unprod31.5%

        \[\leadsto \left(b \cdot x\right) \cdot \color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}} + x \]
      11. sqr-neg31.5%

        \[\leadsto \left(b \cdot x\right) \cdot \sqrt{\color{blue}{a \cdot a}} + x \]
      12. sqrt-unprod14.6%

        \[\leadsto \left(b \cdot x\right) \cdot \color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} + x \]
      13. add-sqr-sqrt30.1%

        \[\leadsto \left(b \cdot x\right) \cdot \color{blue}{a} + x \]
      14. associate-*l*32.1%

        \[\leadsto \color{blue}{b \cdot \left(x \cdot a\right)} + x \]
    9. Applied egg-rr32.1%

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

    if 8.2000000000000001e-17 < y

    1. Initial program 92.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 0 39.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 28.5% accurate, 28.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.17:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{-16}:\\ \;\;\;\;x - a \cdot \left(x \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -0.17)
   (* x (* a (- b)))
   (if (<= y 4.1e-16) (- x (* a (* x z))) (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -0.17) {
		tmp = x * (a * -b);
	} else if (y <= 4.1e-16) {
		tmp = x - (a * (x * z));
	} else {
		tmp = a * (x * -z);
	}
	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.17d0)) then
        tmp = x * (a * -b)
    else if (y <= 4.1d-16) then
        tmp = x - (a * (x * z))
    else
        tmp = a * (x * -z)
    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.17) {
		tmp = x * (a * -b);
	} else if (y <= 4.1e-16) {
		tmp = x - (a * (x * z));
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -0.17:
		tmp = x * (a * -b)
	elif y <= 4.1e-16:
		tmp = x - (a * (x * z))
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -0.17)
		tmp = Float64(x * Float64(a * Float64(-b)));
	elseif (y <= 4.1e-16)
		tmp = Float64(x - Float64(a * Float64(x * z)));
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -0.17)
		tmp = x * (a * -b);
	elseif (y <= 4.1e-16)
		tmp = x - (a * (x * z));
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.17], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e-16], N[(x - N[(a * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.17:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

\mathbf{elif}\;y \leq 4.1 \cdot 10^{-16}:\\
\;\;\;\;x - a \cdot \left(x \cdot z\right)\\

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


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

    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 b around inf 43.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*43.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    12. Step-by-step derivation
      1. associate-*r*13.2%

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

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

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

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

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

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

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

    if -0.170000000000000012 < y < 4.10000000000000006e-16

    1. Initial program 93.1%

      \[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 77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{-a \cdot z}} \]
      2. *-commutative46.3%

        \[\leadsto x \cdot e^{-\color{blue}{z \cdot a}} \]
      3. distribute-rgt-neg-in46.3%

        \[\leadsto x \cdot e^{\color{blue}{z \cdot \left(-a\right)}} \]
    10. Simplified46.3%

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

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

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

        \[\leadsto \color{blue}{x + \left(-a \cdot \left(z \cdot x\right)\right)} \]
      3. sub-neg34.0%

        \[\leadsto \color{blue}{x - a \cdot \left(z \cdot x\right)} \]
    13. Simplified34.0%

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

    if 4.10000000000000006e-16 < y

    1. Initial program 92.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 0 39.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 31.8% accurate, 28.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.42 \cdot 10^{+80}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y 1.42e+80) (* x (- 1.0 (* a (+ z b)))) (* a (* x (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= 1.42e+80) {
		tmp = x * (1.0 - (a * (z + b)));
	} else {
		tmp = a * (x * -z);
	}
	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.42d+80) then
        tmp = x * (1.0d0 - (a * (z + b)))
    else
        tmp = a * (x * -z)
    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.42e+80) {
		tmp = x * (1.0 - (a * (z + b)));
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= 1.42e+80:
		tmp = x * (1.0 - (a * (z + b)))
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= 1.42e+80)
		tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b))));
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= 1.42e+80)
		tmp = x * (1.0 - (a * (z + b)));
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.42e+80], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.42 \cdot 10^{+80}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.4200000000000001e80

    1. Initial program 93.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 65.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - a \cdot \left(\left(b + z\right) \cdot x\right)} \]
    10. Simplified30.5%

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

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

    if 1.4200000000000001e80 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + -1 \cdot \left(a \cdot \left(\left(b + z\right) \cdot x\right)\right)} \]
      2. mul-1-neg5.4%

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

        \[\leadsto \color{blue}{x - a \cdot \left(\left(b + z\right) \cdot x\right)} \]
    10. Simplified5.4%

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

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

        \[\leadsto \color{blue}{-a \cdot \left(z \cdot x\right)} \]
    13. Simplified39.7%

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

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

Alternative 12: 22.7% accurate, 31.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{-292} \lor \neg \left(y \leq 2.3 \cdot 10^{-16}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -7.2e-292) (not (<= y 2.3e-16))) (* a (* x (- z))) x))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -7.2e-292) || !(y <= 2.3e-16)) {
		tmp = a * (x * -z);
	} 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 <= (-7.2d-292)) .or. (.not. (y <= 2.3d-16))) then
        tmp = a * (x * -z)
    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 <= -7.2e-292) || !(y <= 2.3e-16)) {
		tmp = a * (x * -z);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -7.2e-292) or not (y <= 2.3e-16):
		tmp = a * (x * -z)
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -7.2e-292) || !(y <= 2.3e-16))
		tmp = Float64(a * Float64(x * Float64(-z)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -7.2e-292) || ~((y <= 2.3e-16)))
		tmp = a * (x * -z);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.2e-292], N[Not[LessEqual[y, 2.3e-16]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-292} \lor \neg \left(y \leq 2.3 \cdot 10^{-16}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.2000000000000004e-292 or 2.2999999999999999e-16 < y

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-a \cdot \left(\left(b + z\right) \cdot x\right)\right)} \]
      3. unsub-neg16.7%

        \[\leadsto \color{blue}{x - a \cdot \left(\left(b + z\right) \cdot x\right)} \]
    10. Simplified16.7%

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

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

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

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

    if -7.2000000000000004e-292 < y < 2.2999999999999999e-16

    1. Initial program 92.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 81.9%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*81.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{-292} \lor \neg \left(y \leq 2.3 \cdot 10^{-16}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 13: 27.9% accurate, 31.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.00034:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -0.00034)
   (* x (* a (- b)))
   (if (<= y 6.2e-16) x (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -0.00034) {
		tmp = x * (a * -b);
	} else if (y <= 6.2e-16) {
		tmp = x;
	} else {
		tmp = a * (x * -z);
	}
	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.00034d0)) then
        tmp = x * (a * -b)
    else if (y <= 6.2d-16) then
        tmp = x
    else
        tmp = a * (x * -z)
    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.00034) {
		tmp = x * (a * -b);
	} else if (y <= 6.2e-16) {
		tmp = x;
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -0.00034:
		tmp = x * (a * -b)
	elif y <= 6.2e-16:
		tmp = x
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -0.00034)
		tmp = Float64(x * Float64(a * Float64(-b)));
	elseif (y <= 6.2e-16)
		tmp = x;
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -0.00034)
		tmp = x * (a * -b);
	elseif (y <= 6.2e-16)
		tmp = x;
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.00034], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-16], x, N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00034:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

\mathbf{elif}\;y \leq 6.2 \cdot 10^{-16}:\\
\;\;\;\;x\\

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


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

    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 b around inf 43.8%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*43.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} \]
    12. Step-by-step derivation
      1. associate-*r*13.2%

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

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

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

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

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

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

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

    if -3.4e-4 < y < 6.2000000000000002e-16

    1. Initial program 93.1%

      \[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 75.3%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*75.3%

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

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

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

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

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

    if 6.2000000000000002e-16 < y

    1. Initial program 92.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 0 39.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 32.1% accurate, 34.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.5 \cdot 10^{-15}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y 1.5e-15) (- x (* x (* a b))) (* a (* x (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= 1.5e-15) {
		tmp = x - (x * (a * b));
	} else {
		tmp = a * (x * -z);
	}
	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.5d-15) then
        tmp = x - (x * (a * b))
    else
        tmp = a * (x * -z)
    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.5e-15) {
		tmp = x - (x * (a * b));
	} else {
		tmp = a * (x * -z);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= 1.5e-15:
		tmp = x - (x * (a * b))
	else:
		tmp = a * (x * -z)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= 1.5e-15)
		tmp = Float64(x - Float64(x * Float64(a * b)));
	else
		tmp = Float64(a * Float64(x * Float64(-z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= 1.5e-15)
		tmp = x - (x * (a * b));
	else
		tmp = a * (x * -z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.5e-15], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{-15}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.5e-15

    1. Initial program 94.6%

      \[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 66.0%

      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
    3. Step-by-step derivation
      1. associate-*r*66.0%

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

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

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

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

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

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

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

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

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

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

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

    if 1.5e-15 < y

    1. Initial program 92.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 0 39.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 19.1% 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 94.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 b around inf 58.7%

    \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
  3. Step-by-step derivation
    1. associate-*r*58.7%

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification17.5%

    \[\leadsto x \]

Reproduce

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