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

Percentage Accurate: 96.5% → 99.7%
Time: 17.9s
Alternatives: 15
Speedup: 1.5×

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

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

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

      \[\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-def100.0%

      \[\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. Simplified100.0%

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

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

Alternative 2: 85.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(\log z - t\right)\\ \mathbf{if}\;y \leq -1.1 \cdot 10^{-86}:\\ \;\;\;\;x \cdot e^{t_1 - z \cdot a}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-92}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{t_1}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* y (- (log z) t))))
   (if (<= y -1.1e-86)
     (* x (exp (- t_1 (* z a))))
     (if (<= y 1.1e-92)
       (* x (exp (* a (- (log1p (- z)) b))))
       (* x (exp t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (log(z) - t);
	double tmp;
	if (y <= -1.1e-86) {
		tmp = x * exp((t_1 - (z * a)));
	} else if (y <= 1.1e-92) {
		tmp = x * exp((a * (log1p(-z) - b)));
	} else {
		tmp = x * exp(t_1);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = y * (Math.log(z) - t);
	double tmp;
	if (y <= -1.1e-86) {
		tmp = x * Math.exp((t_1 - (z * a)));
	} else if (y <= 1.1e-92) {
		tmp = x * Math.exp((a * (Math.log1p(-z) - b)));
	} else {
		tmp = x * Math.exp(t_1);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = y * (math.log(z) - t)
	tmp = 0
	if y <= -1.1e-86:
		tmp = x * math.exp((t_1 - (z * a)))
	elif y <= 1.1e-92:
		tmp = x * math.exp((a * (math.log1p(-z) - b)))
	else:
		tmp = x * math.exp(t_1)
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(y * Float64(log(z) - t))
	tmp = 0.0
	if (y <= -1.1e-86)
		tmp = Float64(x * exp(Float64(t_1 - Float64(z * a))));
	elseif (y <= 1.1e-92)
		tmp = Float64(x * exp(Float64(a * Float64(log1p(Float64(-z)) - b))));
	else
		tmp = Float64(x * exp(t_1));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e-86], N[(x * N[Exp[N[(t$95$1 - N[(z * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e-92], N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(\log z - t\right)\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{-86}:\\
\;\;\;\;x \cdot e^{t_1 - z \cdot a}\\

\mathbf{elif}\;y \leq 1.1 \cdot 10^{-92}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\

\mathbf{else}:\\
\;\;\;\;x \cdot e^{t_1}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1000000000000001e-86 < y < 1.09999999999999994e-92

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

    if 1.09999999999999994e-92 < y

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{-86}:\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) - z \cdot a}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-92}:\\ \;\;\;\;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} \]

Alternative 3: 99.3% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 83.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{+38} \lor \neg \left(a \leq 6.4 \cdot 10^{+81}\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 -2.9e+38) (not (<= a 6.4e+81)))
   (* 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 <= -2.9e+38) || !(a <= 6.4e+81)) {
		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 <= -2.9e+38) || !(a <= 6.4e+81)) {
		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 <= -2.9e+38) or not (a <= 6.4e+81):
		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 <= -2.9e+38) || !(a <= 6.4e+81))
		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, -2.9e+38], N[Not[LessEqual[a, 6.4e+81]], $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 -2.9 \cdot 10^{+38} \lor \neg \left(a \leq 6.4 \cdot 10^{+81}\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 < -2.90000000000000007e38 or 6.4e81 < a

    1. Initial program 94.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 80.2%

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

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

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

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

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

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

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

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

    if -2.90000000000000007e38 < a < 6.4e81

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{+38} \lor \neg \left(a \leq 6.4 \cdot 10^{+81}\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} \]

Alternative 5: 82.6% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{-91} \lor \neg \left(y \leq 2.75 \cdot 10^{-94}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - 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 y < -1.6199999999999999e-91 or 2.74999999999999995e-94 < y

    1. Initial program 98.2%

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

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

    if -1.6199999999999999e-91 < y < 2.74999999999999995e-94

    1. Initial program 96.7%

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

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

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

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

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

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

Alternative 6: 71.3% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -390 \lor \neg \left(t \leq 5 \cdot 10^{-7}\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 -390.0) (not (<= t 5e-7)))
   (* 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 <= -390.0) || !(t <= 5e-7)) {
		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 <= (-390.0d0)) .or. (.not. (t <= 5d-7))) 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 <= -390.0) || !(t <= 5e-7)) {
		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 <= -390.0) or not (t <= 5e-7):
		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 <= -390.0) || !(t <= 5e-7))
		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 <= -390.0) || ~((t <= 5e-7)))
		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, -390.0], N[Not[LessEqual[t, 5e-7]], $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 -390 \lor \neg \left(t \leq 5 \cdot 10^{-7}\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 < -390 or 4.99999999999999977e-7 < t

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

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

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

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

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

    if -390 < t < 4.99999999999999977e-7

    1. Initial program 99.0%

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

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

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

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

Alternative 7: 69.9% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2950000 \lor \neg \left(a \leq 2.7 \cdot 10^{+81}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.95e6 or 2.6999999999999999e81 < a

    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 76.5%

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

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

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

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

    if -2.95e6 < a < 2.6999999999999999e81

    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 82.9%

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.1%

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

Alternative 8: 54.7% accurate, 3.0× speedup?

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

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

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


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

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 37.9%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-137.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in37.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{t \cdot \left(-y\right)}\right) \]
    7. Simplified37.9%

      \[\leadsto x \cdot \color{blue}{\left(1 + t \cdot \left(-y\right)\right)} \]
    8. Taylor expanded in x around 0 37.9%

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. *-commutative37.9%

        \[\leadsto x \cdot \left(1 + \left(-\color{blue}{y \cdot t}\right)\right) \]
      3. unsub-neg37.9%

        \[\leadsto x \cdot \color{blue}{\left(1 - y \cdot t\right)} \]
    10. Simplified37.9%

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

    if -3.2e11 < t

    1. Initial program 97.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -320000000000:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 9: 27.5% accurate, 25.8× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \left(t \cdot \left(-x\right)\right)\\
\mathbf{if}\;y \leq -33000000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2 \cdot 10^{-116}:\\
\;\;\;\;x\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.3e13 or 4.49999999999999992e161 < 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. Taylor expanded in t around inf 75.5%

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 26.9%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-126.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in26.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{t \cdot \left(-y\right)}\right) \]
    7. Simplified26.9%

      \[\leadsto x \cdot \color{blue}{\left(1 + t \cdot \left(-y\right)\right)} \]
    8. Taylor expanded in t around inf 22.3%

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

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*25.7%

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

        \[\leadsto -\color{blue}{y \cdot \left(t \cdot x\right)} \]
      4. *-commutative25.7%

        \[\leadsto -y \cdot \color{blue}{\left(x \cdot t\right)} \]
    10. Simplified25.7%

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

    if -3.3e13 < y < 2e-116

    1. Initial program 95.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 t around inf 57.3%

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 41.3%

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

    if 2e-116 < y < 4.49999999999999992e161

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 28.2% accurate, 25.8× speedup?

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

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

\mathbf{elif}\;y \leq 3.4 \cdot 10^{-116}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.6e12

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 26.9%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-126.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in26.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{t \cdot \left(-y\right)}\right) \]
    7. Simplified26.9%

      \[\leadsto x \cdot \color{blue}{\left(1 + t \cdot \left(-y\right)\right)} \]
    8. Taylor expanded in t around inf 20.0%

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

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. *-commutative20.0%

        \[\leadsto -\color{blue}{\left(x \cdot y\right) \cdot t} \]
      3. associate-*l*26.7%

        \[\leadsto -\color{blue}{x \cdot \left(y \cdot t\right)} \]
      4. distribute-rgt-neg-out26.7%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot t\right)} \]
      5. distribute-rgt-neg-in26.7%

        \[\leadsto x \cdot \color{blue}{\left(y \cdot \left(-t\right)\right)} \]
    10. Simplified26.7%

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

    if -7.6e12 < y < 3.39999999999999992e-116

    1. Initial program 95.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 t around inf 57.3%

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 41.3%

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

    if 3.39999999999999992e-116 < y < 1.3499999999999999e161

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3499999999999999e161 < y

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 27.1%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-127.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in27.1%

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

      \[\leadsto x \cdot \color{blue}{\left(1 + t \cdot \left(-y\right)\right)} \]
    8. Taylor expanded in t around inf 27.0%

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

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*37.2%

        \[\leadsto -\color{blue}{\left(t \cdot x\right) \cdot y} \]
      3. *-commutative37.2%

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

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

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

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

Alternative 11: 33.3% accurate, 28.3× speedup?

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

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

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

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


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

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 26.9%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-126.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in26.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{t \cdot \left(-y\right)}\right) \]
    7. Simplified26.9%

      \[\leadsto x \cdot \color{blue}{\left(1 + t \cdot \left(-y\right)\right)} \]
    8. Taylor expanded in t around inf 20.0%

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

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. *-commutative20.0%

        \[\leadsto -\color{blue}{\left(x \cdot y\right) \cdot t} \]
      3. associate-*l*26.7%

        \[\leadsto -\color{blue}{x \cdot \left(y \cdot t\right)} \]
      4. distribute-rgt-neg-out26.7%

        \[\leadsto \color{blue}{x \cdot \left(-y \cdot t\right)} \]
      5. distribute-rgt-neg-in26.7%

        \[\leadsto x \cdot \color{blue}{\left(y \cdot \left(-t\right)\right)} \]
    10. Simplified26.7%

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

    if -2.6e13 < y < 3.19999999999999981e-10

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

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

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

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

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

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

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

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

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

    if 3.19999999999999981e-10 < y

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 21.1%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-121.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in21.1%

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

      \[\leadsto x \cdot \color{blue}{\left(1 + t \cdot \left(-y\right)\right)} \]
    8. Taylor expanded in t around inf 24.3%

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

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*29.3%

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

        \[\leadsto -\color{blue}{y \cdot \left(t \cdot x\right)} \]
      4. *-commutative29.3%

        \[\leadsto -y \cdot \color{blue}{\left(x \cdot t\right)} \]
    10. Simplified29.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -26000000000000:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-10}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(-x\right)\right)\\ \end{array} \]

Alternative 12: 33.2% accurate, 28.3× speedup?

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

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

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

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


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

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 26.9%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-126.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in26.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{t \cdot \left(-y\right)}\right) \]
    7. Simplified26.9%

      \[\leadsto x \cdot \color{blue}{\left(1 + t \cdot \left(-y\right)\right)} \]
    8. Taylor expanded in x around 0 26.9%

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. *-commutative26.9%

        \[\leadsto x \cdot \left(1 + \left(-\color{blue}{y \cdot t}\right)\right) \]
      3. unsub-neg26.9%

        \[\leadsto x \cdot \color{blue}{\left(1 - y \cdot t\right)} \]
    10. Simplified26.9%

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

    if -4.2e13 < y < 4.60000000000000014e-10

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

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

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

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

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

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

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

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

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

    if 4.60000000000000014e-10 < y

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 21.1%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-121.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in21.1%

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

      \[\leadsto x \cdot \color{blue}{\left(1 + t \cdot \left(-y\right)\right)} \]
    8. Taylor expanded in t around inf 24.3%

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

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*29.3%

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

        \[\leadsto -\color{blue}{y \cdot \left(t \cdot x\right)} \]
      4. *-commutative29.3%

        \[\leadsto -y \cdot \color{blue}{\left(x \cdot t\right)} \]
    10. Simplified29.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -42000000000000:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-10}:\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(-x\right)\right)\\ \end{array} \]

Alternative 13: 26.9% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-38} \lor \neg \left(y \leq 3.4 \cdot 10^{-116}\right):\\
\;\;\;\;\left(a \cdot b\right) \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.20000000000000026e-38 or 3.39999999999999992e-116 < 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. Taylor expanded in b around inf 44.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.20000000000000026e-38 < y < 3.39999999999999992e-116

    1. Initial program 95.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 t around inf 56.4%

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 44.2%

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

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

Alternative 14: 26.8% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7200000000000 \lor \neg \left(y \leq 6.8 \cdot 10^{-78}\right):\\
\;\;\;\;y \cdot \left(t \cdot \left(-x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.2e12 or 6.80000000000000023e-78 < y

    1. Initial program 99.3%

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 24.1%

      \[\leadsto x \cdot \color{blue}{\left(1 + -1 \cdot \left(t \cdot y\right)\right)} \]
    6. Step-by-step derivation
      1. neg-mul-124.1%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-t \cdot y\right)}\right) \]
      2. distribute-rgt-neg-in24.1%

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

      \[\leadsto x \cdot \color{blue}{\left(1 + t \cdot \left(-y\right)\right)} \]
    8. Taylor expanded in t around inf 22.3%

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

        \[\leadsto \color{blue}{-t \cdot \left(x \cdot y\right)} \]
      2. associate-*r*24.9%

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

        \[\leadsto -\color{blue}{y \cdot \left(t \cdot x\right)} \]
      4. *-commutative24.9%

        \[\leadsto -y \cdot \color{blue}{\left(x \cdot t\right)} \]
    10. Simplified24.9%

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

    if -7.2e12 < y < 6.80000000000000023e-78

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
    5. Taylor expanded in y around 0 39.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7200000000000 \lor \neg \left(y \leq 6.8 \cdot 10^{-78}\right):\\ \;\;\;\;y \cdot \left(t \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 15: 19.4% 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.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 64.0%

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

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

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

    \[\leadsto x \cdot e^{\color{blue}{-y \cdot t}} \]
  5. Taylor expanded in y around 0 20.2%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification20.2%

    \[\leadsto x \]

Reproduce

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