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

Percentage Accurate: 96.4% → 99.4%
Time: 19.7s
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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 0.8× speedup?

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

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

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

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

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

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

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

Alternative 2: 70.8% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{{\left(e^{a}\right)}^{b}}\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -6.2 \cdot 10^{-221}:\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{elif}\;a \leq 1.05 \cdot 10^{+29}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.5000000000000006e33 or 1.0500000000000001e29 < a

    1. Initial program 94.4%

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

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

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

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

        \[\leadsto e^{\color{blue}{-a \cdot b}} \cdot x \]
    6. Simplified78.9%

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in a around inf 78.9%

      \[\leadsto \color{blue}{x \cdot e^{-a \cdot b}} \]
    8. Step-by-step derivation
      1. exp-neg78.9%

        \[\leadsto x \cdot \color{blue}{\frac{1}{e^{a \cdot b}}} \]
      2. *-commutative78.9%

        \[\leadsto x \cdot \frac{1}{e^{\color{blue}{b \cdot a}}} \]
      3. exp-prod58.2%

        \[\leadsto x \cdot \frac{1}{\color{blue}{{\left(e^{b}\right)}^{a}}} \]
      4. associate-*r/58.2%

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

        \[\leadsto \frac{\color{blue}{x}}{{\left(e^{b}\right)}^{a}} \]
      6. exp-prod78.9%

        \[\leadsto \frac{x}{\color{blue}{e^{b \cdot a}}} \]
      7. *-commutative78.9%

        \[\leadsto \frac{x}{e^{\color{blue}{a \cdot b}}} \]
      8. exp-prod84.4%

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

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

    if -5.5000000000000006e33 < a < -6.1999999999999998e-221

    1. Initial program 99.8%

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

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

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

    if -6.1999999999999998e-221 < a < 1.0500000000000001e29

    1. Initial program 99.9%

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative79.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{+33}:\\ \;\;\;\;\frac{x}{{\left(e^{a}\right)}^{b}}\\ \mathbf{elif}\;a \leq -6.2 \cdot 10^{-221}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+29}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{{\left(e^{a}\right)}^{b}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 83.1% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.2 \cdot 10^{+33} \lor \neg \left(a \leq 3.6 \cdot 10^{+28}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.1999999999999999e33 or 3.5999999999999999e28 < a

    1. Initial program 94.4%

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

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

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

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

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

    if -8.1999999999999999e33 < a < 3.5999999999999999e28

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.2 \cdot 10^{+33} \lor \neg \left(a \leq 3.6 \cdot 10^{+28}\right):\\ \;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.1% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+35} \lor \neg \left(a \leq 1.1 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x}{{\left(e^{a}\right)}^{b}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.0999999999999999e35 or 1.0999999999999999e27 < a

    1. Initial program 94.4%

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

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

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

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

        \[\leadsto e^{\color{blue}{-a \cdot b}} \cdot x \]
    6. Simplified78.9%

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in a around inf 78.9%

      \[\leadsto \color{blue}{x \cdot e^{-a \cdot b}} \]
    8. Step-by-step derivation
      1. exp-neg78.9%

        \[\leadsto x \cdot \color{blue}{\frac{1}{e^{a \cdot b}}} \]
      2. *-commutative78.9%

        \[\leadsto x \cdot \frac{1}{e^{\color{blue}{b \cdot a}}} \]
      3. exp-prod58.2%

        \[\leadsto x \cdot \frac{1}{\color{blue}{{\left(e^{b}\right)}^{a}}} \]
      4. associate-*r/58.2%

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

        \[\leadsto \frac{\color{blue}{x}}{{\left(e^{b}\right)}^{a}} \]
      6. exp-prod78.9%

        \[\leadsto \frac{x}{\color{blue}{e^{b \cdot a}}} \]
      7. *-commutative78.9%

        \[\leadsto \frac{x}{e^{\color{blue}{a \cdot b}}} \]
      8. exp-prod84.4%

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

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

    if -2.0999999999999999e35 < a < 1.0999999999999999e27

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.1 \cdot 10^{+35} \lor \neg \left(a \leq 1.1 \cdot 10^{+27}\right):\\ \;\;\;\;\frac{x}{{\left(e^{a}\right)}^{b}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 87.6% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -47000:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\


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

    1. Initial program 98.4%

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative75.7%

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

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

    if -47000 < t

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\log \left({z}^{y}\right) - a \cdot b}} \]
      3. exp-to-pow85.7%

        \[\leadsto x \cdot e^{\log \color{blue}{\left(e^{\log z \cdot y}\right)} - a \cdot b} \]
      4. *-commutative85.7%

        \[\leadsto x \cdot e^{\log \left(e^{\color{blue}{y \cdot \log z}}\right) - a \cdot b} \]
      5. rem-log-exp93.8%

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \log z} - a \cdot b} \]
    9. Simplified93.8%

      \[\leadsto x \cdot e^{\color{blue}{y \cdot \log z - a \cdot b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.5%

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

Alternative 6: 96.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (- (* y (- (log z) t)) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) - (a * b)));
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) - (a * 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 * b)));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) - (a * b)))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * b))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) - (a * 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 * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

    \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right) + y \cdot \left(\log z - t\right)}} \]
  4. Final simplification97.3%

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

Alternative 7: 68.9% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{if}\;a \leq -1.4 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -2.5 \cdot 10^{-222}:\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{elif}\;a \leq 2.8 \cdot 10^{+23}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.40000000000000004e34 or 2.8e23 < a

    1. Initial program 94.4%

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

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

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

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

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

    if -1.40000000000000004e34 < a < -2.50000000000000004e-222

    1. Initial program 99.8%

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

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

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

    if -2.50000000000000004e-222 < a < 2.8e23

    1. Initial program 99.9%

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative79.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.4 \cdot 10^{+34}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;a \leq -2.5 \cdot 10^{-222}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{+23}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 71.0% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -880 \lor \neg \left(t \leq 9.6 \cdot 10^{-55}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -880 or 9.59999999999999966e-55 < t

    1. Initial program 98.6%

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
      3. *-commutative79.6%

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

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

    if -880 < t < 9.59999999999999966e-55

    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. Add Preprocessing
    3. Taylor expanded in y around inf 65.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -880 \lor \neg \left(t \leq 9.6 \cdot 10^{-55}\right):\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 56.2% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-128} \lor \neg \left(y \leq 4.8 \cdot 10^{+27}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.5000000000000001e-128 or 4.79999999999999995e27 < y

    1. Initial program 98.8%

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

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

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

    if -2.5000000000000001e-128 < y < 4.79999999999999995e27

    1. Initial program 94.8%

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

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

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

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

        \[\leadsto e^{\color{blue}{-a \cdot b}} \cdot x \]
    6. Simplified84.3%

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in b around 0 58.8%

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

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

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

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

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

        \[\leadsto x + b \cdot \left(0.5 \cdot \left({a}^{2} \cdot \left(x \cdot b\right)\right) - \color{blue}{x \cdot a}\right) \]
    9. Simplified58.8%

      \[\leadsto \color{blue}{x + b \cdot \left(0.5 \cdot \left({a}^{2} \cdot \left(x \cdot b\right)\right) - x \cdot a\right)} \]
    10. Taylor expanded in a around 0 59.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{-128} \lor \neg \left(y \leq 4.8 \cdot 10^{+27}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x + b \cdot \left(a \cdot \left(0.5 \cdot \left(a \cdot \left(x \cdot b\right)\right) - x\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 35.8% accurate, 12.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.9 \cdot 10^{+35} \lor \neg \left(a \leq 7.2 \cdot 10^{-20}\right):\\
\;\;\;\;x + b \cdot \left(a \cdot \left(0.5 \cdot \left(a \cdot \left(x \cdot b\right)\right) - x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.90000000000000025e35 or 7.19999999999999948e-20 < a

    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. Add Preprocessing
    3. Taylor expanded in z around 0 94.7%

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

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

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

        \[\leadsto e^{\color{blue}{-a \cdot b}} \cdot x \]
    6. Simplified76.5%

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in b around 0 40.9%

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

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

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

        \[\leadsto x + b \cdot \color{blue}{\left(0.5 \cdot \left({a}^{2} \cdot \left(b \cdot x\right)\right) - a \cdot x\right)} \]
      4. *-commutative40.9%

        \[\leadsto x + b \cdot \left(0.5 \cdot \left({a}^{2} \cdot \color{blue}{\left(x \cdot b\right)}\right) - a \cdot x\right) \]
      5. *-commutative40.9%

        \[\leadsto x + b \cdot \left(0.5 \cdot \left({a}^{2} \cdot \left(x \cdot b\right)\right) - \color{blue}{x \cdot a}\right) \]
    9. Simplified40.9%

      \[\leadsto \color{blue}{x + b \cdot \left(0.5 \cdot \left({a}^{2} \cdot \left(x \cdot b\right)\right) - x \cdot a\right)} \]
    10. Taylor expanded in a around 0 41.3%

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

    if -4.90000000000000025e35 < a < 7.19999999999999948e-20

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{x + x \cdot \left(y \cdot \left(\log z - t\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*47.7%

        \[\leadsto x + \color{blue}{\left(x \cdot y\right) \cdot \left(\log z - t\right)} \]
    6. Simplified47.7%

      \[\leadsto \color{blue}{x + \left(x \cdot y\right) \cdot \left(\log z - t\right)} \]
    7. Taylor expanded in t around inf 45.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.9 \cdot 10^{+35} \lor \neg \left(a \leq 7.2 \cdot 10^{-20}\right):\\ \;\;\;\;x + b \cdot \left(a \cdot \left(0.5 \cdot \left(a \cdot \left(x \cdot b\right)\right) - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 30.6% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.4 \cdot 10^{+35}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\

\mathbf{elif}\;a \leq 4.2 \cdot 10^{-19}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.39999999999999965e35

    1. Initial program 90.3%

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

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

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

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

        \[\leadsto e^{\color{blue}{-a \cdot b}} \cdot x \]
    6. Simplified75.7%

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in a around 0 22.4%

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

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

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

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

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

    if -6.39999999999999965e35 < a < 4.1999999999999998e-19

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{x + x \cdot \left(y \cdot \left(\log z - t\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*47.7%

        \[\leadsto x + \color{blue}{\left(x \cdot y\right) \cdot \left(\log z - t\right)} \]
    6. Simplified47.7%

      \[\leadsto \color{blue}{x + \left(x \cdot y\right) \cdot \left(\log z - t\right)} \]
    7. Taylor expanded in t around inf 45.9%

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

    if 4.1999999999999998e-19 < a

    1. Initial program 98.6%

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

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

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

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

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

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in a around 0 28.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.4 \cdot 10^{+35}:\\ \;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{-19}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 31.9% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+162}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\

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

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


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

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{x + x \cdot \left(y \cdot \left(\log z - t\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*33.6%

        \[\leadsto x + \color{blue}{\left(x \cdot y\right) \cdot \left(\log z - t\right)} \]
    6. Simplified33.6%

      \[\leadsto \color{blue}{x + \left(x \cdot y\right) \cdot \left(\log z - t\right)} \]
    7. Taylor expanded in t around inf 22.8%

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

    if -1.6000000000000001e162 < y < 1.02e105

    1. Initial program 96.6%

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

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

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

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

        \[\leadsto e^{\color{blue}{-a \cdot b}} \cdot x \]
    6. Simplified71.7%

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in a around 0 40.0%

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

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

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

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

    if 1.02e105 < y

    1. Initial program 98.1%

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

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

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

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

        \[\leadsto e^{\color{blue}{-a \cdot b}} \cdot x \]
    6. Simplified43.5%

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in a around 0 14.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+162}:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+105}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 27.1% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{-23} \lor \neg \left(y \leq 3.95 \cdot 10^{-16}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.8999999999999998e-23 or 3.9500000000000001e-16 < y

    1. Initial program 98.7%

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

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

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

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

        \[\leadsto e^{\color{blue}{-a \cdot b}} \cdot x \]
    6. Simplified45.3%

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in a around 0 15.7%

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

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

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

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

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

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

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

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

    if -4.8999999999999998e-23 < y < 3.9500000000000001e-16

    1. Initial program 95.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.9 \cdot 10^{-23} \lor \neg \left(y \leq 3.95 \cdot 10^{-16}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 30.2% accurate, 26.2× speedup?

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

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

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


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

    1. Initial program 97.0%

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

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

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

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

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

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in a around 0 35.1%

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

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

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

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

    if 1.02e105 < y

    1. Initial program 98.1%

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

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

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

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

        \[\leadsto e^{\color{blue}{-a \cdot b}} \cdot x \]
    6. Simplified43.5%

      \[\leadsto \color{blue}{e^{-a \cdot b} \cdot x} \]
    7. Taylor expanded in a around 0 14.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.02 \cdot 10^{+105}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 18.9% accurate, 315.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Add Preprocessing

Reproduce

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