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

Percentage Accurate: 96.7% → 99.7%
Time: 18.6s
Alternatives: 18
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 18 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.7% 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 96.7%

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

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

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

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

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

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

Alternative 2: 99.6% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

Alternative 3: 86.4% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -850000000000 \lor \neg \left(y \leq 1.85 \cdot 10^{-83}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.5e11 or 1.84999999999999997e-83 < y

    1. Initial program 97.8%

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

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

    if -8.5e11 < y < 1.84999999999999997e-83

    1. Initial program 95.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 84.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 87.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -6.5 \cdot 10^{+56}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\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 -6.5e+56)
   (* x (exp (* y (- t))))
   (* 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 <= -6.5e+56) {
		tmp = x * exp((y * -t));
	} 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 <= (-6.5d+56)) then
        tmp = x * exp((y * -t))
    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 <= -6.5e+56) {
		tmp = x * Math.exp((y * -t));
	} 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 <= -6.5e+56:
		tmp = x * math.exp((y * -t))
	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 <= -6.5e+56)
		tmp = Float64(x * exp(Float64(y * Float64(-t))));
	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 <= -6.5e+56)
		tmp = x * exp((y * -t));
	else
		tmp = x * exp(((y * log(z)) - (a * b)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.5e+56], N[(x * N[Exp[N[(y * (-t)), $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 -6.5 \cdot 10^{+56}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\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 < -6.5000000000000001e56

    1. Initial program 98.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 85.2%

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

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

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

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

    if -6.5000000000000001e56 < t

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \log z - a \cdot b}} \]
    7. Simplified91.3%

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

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

Alternative 5: 96.2% 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 96.7%

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

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

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

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

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

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

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

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

Alternative 6: 71.6% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{a \cdot \left(-b\right)}\\ t_2 := x \cdot e^{y \cdot \left(-t\right)}\\ t_3 := x \cdot {z}^{y}\\ \mathbf{if}\;t \leq -4.5 \cdot 10^{+108}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{-106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-280}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{-237}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.14 \cdot 10^{-85}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 1.04 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (exp (* a (- b)))))
        (t_2 (* x (exp (* y (- t)))))
        (t_3 (* x (pow z y))))
   (if (<= t -4.5e+108)
     t_2
     (if (<= t -2.1e-106)
       t_1
       (if (<= t 5.2e-280)
         t_3
         (if (<= t 1.56e-237)
           t_1
           (if (<= t 1.14e-85) t_3 (if (<= t 1.04e+30) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((a * -b));
	double t_2 = x * exp((y * -t));
	double t_3 = x * pow(z, y);
	double tmp;
	if (t <= -4.5e+108) {
		tmp = t_2;
	} else if (t <= -2.1e-106) {
		tmp = t_1;
	} else if (t <= 5.2e-280) {
		tmp = t_3;
	} else if (t <= 1.56e-237) {
		tmp = t_1;
	} else if (t <= 1.14e-85) {
		tmp = t_3;
	} else if (t <= 1.04e+30) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x * exp((a * -b))
    t_2 = x * exp((y * -t))
    t_3 = x * (z ** y)
    if (t <= (-4.5d+108)) then
        tmp = t_2
    else if (t <= (-2.1d-106)) then
        tmp = t_1
    else if (t <= 5.2d-280) then
        tmp = t_3
    else if (t <= 1.56d-237) then
        tmp = t_1
    else if (t <= 1.14d-85) then
        tmp = t_3
    else if (t <= 1.04d+30) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * Math.exp((a * -b));
	double t_2 = x * Math.exp((y * -t));
	double t_3 = x * Math.pow(z, y);
	double tmp;
	if (t <= -4.5e+108) {
		tmp = t_2;
	} else if (t <= -2.1e-106) {
		tmp = t_1;
	} else if (t <= 5.2e-280) {
		tmp = t_3;
	} else if (t <= 1.56e-237) {
		tmp = t_1;
	} else if (t <= 1.14e-85) {
		tmp = t_3;
	} else if (t <= 1.04e+30) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((a * -b))
	t_2 = x * math.exp((y * -t))
	t_3 = x * math.pow(z, y)
	tmp = 0
	if t <= -4.5e+108:
		tmp = t_2
	elif t <= -2.1e-106:
		tmp = t_1
	elif t <= 5.2e-280:
		tmp = t_3
	elif t <= 1.56e-237:
		tmp = t_1
	elif t <= 1.14e-85:
		tmp = t_3
	elif t <= 1.04e+30:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(a * Float64(-b))))
	t_2 = Float64(x * exp(Float64(y * Float64(-t))))
	t_3 = Float64(x * (z ^ y))
	tmp = 0.0
	if (t <= -4.5e+108)
		tmp = t_2;
	elseif (t <= -2.1e-106)
		tmp = t_1;
	elseif (t <= 5.2e-280)
		tmp = t_3;
	elseif (t <= 1.56e-237)
		tmp = t_1;
	elseif (t <= 1.14e-85)
		tmp = t_3;
	elseif (t <= 1.04e+30)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * exp((a * -b));
	t_2 = x * exp((y * -t));
	t_3 = x * (z ^ y);
	tmp = 0.0;
	if (t <= -4.5e+108)
		tmp = t_2;
	elseif (t <= -2.1e-106)
		tmp = t_1;
	elseif (t <= 5.2e-280)
		tmp = t_3;
	elseif (t <= 1.56e-237)
		tmp = t_1;
	elseif (t <= 1.14e-85)
		tmp = t_3;
	elseif (t <= 1.04e+30)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+108], t$95$2, If[LessEqual[t, -2.1e-106], t$95$1, If[LessEqual[t, 5.2e-280], t$95$3, If[LessEqual[t, 1.56e-237], t$95$1, If[LessEqual[t, 1.14e-85], t$95$3, If[LessEqual[t, 1.04e+30], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -2.1 \cdot 10^{-106}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 5.2 \cdot 10^{-280}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t \leq 1.56 \cdot 10^{-237}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.14 \cdot 10^{-85}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t \leq 1.04 \cdot 10^{+30}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.5e108 or 1.04e30 < t

    1. Initial program 96.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 80.4%

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

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

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

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

    if -4.5e108 < t < -2.10000000000000003e-106 or 5.2e-280 < t < 1.5599999999999999e-237 or 1.1400000000000001e-85 < t < 1.04e30

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

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

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

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

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

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

    if -2.10000000000000003e-106 < t < 5.2e-280 or 1.5599999999999999e-237 < t < 1.1400000000000001e-85

    1. Initial program 94.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.5 \cdot 10^{+108}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{-106}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-280}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 1.56 \cdot 10^{-237}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;t \leq 1.14 \cdot 10^{-85}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;t \leq 1.04 \cdot 10^{+30}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \end{array} \]

Alternative 7: 74.3% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot {z}^{y}\\ \mathbf{if}\;y \leq -1.15 \cdot 10^{+49}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-80}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+52} \lor \neg \left(y \leq 8 \cdot 10^{+126}\right) \land y \leq 2.6 \cdot 10^{+210}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (pow z y))))
   (if (<= y -1.15e+49)
     t_1
     (if (<= y 3.9e-80)
       (* x (exp (* a (- (- z) b))))
       (if (or (<= y 6.6e+52) (and (not (<= y 8e+126)) (<= y 2.6e+210)))
         (* x (exp (* y (- t))))
         t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * pow(z, y);
	double tmp;
	if (y <= -1.15e+49) {
		tmp = t_1;
	} else if (y <= 3.9e-80) {
		tmp = x * exp((a * (-z - b)));
	} else if ((y <= 6.6e+52) || (!(y <= 8e+126) && (y <= 2.6e+210))) {
		tmp = x * exp((y * -t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (z ** y)
    if (y <= (-1.15d+49)) then
        tmp = t_1
    else if (y <= 3.9d-80) then
        tmp = x * exp((a * (-z - b)))
    else if ((y <= 6.6d+52) .or. (.not. (y <= 8d+126)) .and. (y <= 2.6d+210)) then
        tmp = x * exp((y * -t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * Math.pow(z, y);
	double tmp;
	if (y <= -1.15e+49) {
		tmp = t_1;
	} else if (y <= 3.9e-80) {
		tmp = x * Math.exp((a * (-z - b)));
	} else if ((y <= 6.6e+52) || (!(y <= 8e+126) && (y <= 2.6e+210))) {
		tmp = x * Math.exp((y * -t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.pow(z, y)
	tmp = 0
	if y <= -1.15e+49:
		tmp = t_1
	elif y <= 3.9e-80:
		tmp = x * math.exp((a * (-z - b)))
	elif (y <= 6.6e+52) or (not (y <= 8e+126) and (y <= 2.6e+210)):
		tmp = x * math.exp((y * -t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * (z ^ y))
	tmp = 0.0
	if (y <= -1.15e+49)
		tmp = t_1;
	elseif (y <= 3.9e-80)
		tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b))));
	elseif ((y <= 6.6e+52) || (!(y <= 8e+126) && (y <= 2.6e+210)))
		tmp = Float64(x * exp(Float64(y * Float64(-t))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * (z ^ y);
	tmp = 0.0;
	if (y <= -1.15e+49)
		tmp = t_1;
	elseif (y <= 3.9e-80)
		tmp = x * exp((a * (-z - b)));
	elseif ((y <= 6.6e+52) || (~((y <= 8e+126)) && (y <= 2.6e+210)))
		tmp = x * exp((y * -t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.15e+49], t$95$1, If[LessEqual[y, 3.9e-80], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 6.6e+52], And[N[Not[LessEqual[y, 8e+126]], $MachinePrecision], LessEqual[y, 2.6e+210]]], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{+49}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{-80}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\

\mathbf{elif}\;y \leq 6.6 \cdot 10^{+52} \lor \neg \left(y \leq 8 \cdot 10^{+126}\right) \land y \leq 2.6 \cdot 10^{+210}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.15000000000000001e49 or 6.6e52 < y < 7.9999999999999994e126 or 2.5999999999999999e210 < y

    1. Initial program 97.7%

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

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

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

    if -1.15000000000000001e49 < y < 3.8999999999999998e-80

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.8999999999999998e-80 < y < 6.6e52 or 7.9999999999999994e126 < y < 2.5999999999999999e210

    1. Initial program 97.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+49}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-80}:\\ \;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+52} \lor \neg \left(y \leq 8 \cdot 10^{+126}\right) \land y \leq 2.6 \cdot 10^{+210}:\\ \;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 8: 73.3% accurate, 2.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.9000000000000001e49 or 205000 < y

    1. Initial program 97.4%

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

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

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

    if -3.9000000000000001e49 < y < 205000

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

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

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

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

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

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

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

Alternative 9: 54.5% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -6 \cdot 10^{+49}:\\ \;\;\;\;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 -6e+49) (* 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 <= -6e+49) {
		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 <= (-6d+49)) 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 <= -6e+49) {
		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 <= -6e+49:
		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 <= -6e+49)
		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 <= -6e+49)
		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, -6e+49], 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 -6 \cdot 10^{+49}:\\
\;\;\;\;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 < -6.0000000000000005e49

    1. Initial program 98.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 84.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x + -1 \cdot \left(y \cdot \left(t \cdot x\right)\right)} \]
      2. mul-1-neg27.3%

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

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

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

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

    if -6.0000000000000005e49 < t

    1. Initial program 96.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 66.7%

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

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

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

Alternative 10: 25.7% accurate, 25.8× speedup?

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

\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot \left(x \cdot b\right)\\
\mathbf{if}\;a \leq -1.7 \cdot 10^{+37}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 5.5 \cdot 10^{-76}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.70000000000000003e37 or 1.08e174 < a

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.70000000000000003e37 < a < 5.50000000000000014e-76

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if 5.50000000000000014e-76 < a < 1.08e174

    1. Initial program 96.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 53.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.7 \cdot 10^{+37}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{-76}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.08 \cdot 10^{+174}:\\ \;\;\;\;t \cdot \left(-x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \]

Alternative 11: 26.1% accurate, 25.8× speedup?

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

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

\mathbf{elif}\;a \leq 1.08 \cdot 10^{-75}:\\
\;\;\;\;x\\

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

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.45000000000000013e35 < a < 1.08e-75

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if 1.08e-75 < a < 1.21999999999999996e174

    1. Initial program 96.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 53.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.21999999999999996e174 < a

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.45 \cdot 10^{+35}:\\ \;\;\;\;\left(a \cdot b\right) \cdot \left(-x\right)\\ \mathbf{elif}\;a \leq 1.08 \cdot 10^{-75}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.22 \cdot 10^{+174}:\\ \;\;\;\;t \cdot \left(-x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \]

Alternative 12: 34.1% accurate, 28.3× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000018e56 < y < 2.9000000000000002e-6

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

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

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

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

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

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

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

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

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

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

    if 2.9000000000000002e-6 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 27.0% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -640000000000 \lor \neg \left(y \leq 1.3 \cdot 10^{+14}\right):\\
\;\;\;\;t \cdot \left(-x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.4e11 or 1.3e14 < y

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.4e11 < y < 1.3e14

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

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

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

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

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

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

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

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

Alternative 14: 28.5% accurate, 31.1× speedup?

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

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

\mathbf{elif}\;y \leq 135000000:\\
\;\;\;\;x\\

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


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

    1. Initial program 98.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + -1 \cdot \left(y \cdot \left(t \cdot x\right)\right)} \]
      2. mul-1-neg12.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.6e11 < y < 1.35e8

    1. Initial program 95.8%

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

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

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

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

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

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

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

    if 1.35e8 < y

    1. Initial program 96.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x + -1 \cdot \left(y \cdot \left(t \cdot x\right)\right)} \]
      2. mul-1-neg15.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -560000000000:\\ \;\;\;\;t \cdot \left(-x \cdot y\right)\\ \mathbf{elif}\;y \leq 135000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot t\right) \cdot \left(-y\right)\\ \end{array} \]

Alternative 15: 24.1% accurate, 34.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{+14} \lor \neg \left(y \leq 4 \cdot 10^{+42}\right):\\
\;\;\;\;b \cdot \left(x \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.7e14 or 4.00000000000000018e42 < y

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-a\right) \cdot \left(b \cdot x\right)} \]
    11. Step-by-step derivation
      1. expm1-log1p-u14.0%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-a\right) \cdot \left(b \cdot x\right)\right)} - 1} \]
      3. add-sqr-sqrt9.9%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}} \cdot \left(b \cdot x\right)\right)} - 1 \]
      5. sqr-neg27.6%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} \cdot \left(b \cdot x\right)\right)} - 1 \]
      7. add-sqr-sqrt25.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{a} \cdot \left(b \cdot x\right)\right)} - 1 \]
      8. associate-*r*25.3%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(a \cdot b\right) \cdot x}\right)} - 1 \]
    12. Applied egg-rr25.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(a \cdot b\right) \cdot x\right)} - 1} \]
    13. Step-by-step derivation
      1. expm1-def14.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot b\right) \cdot x\right)\right)} \]
      2. expm1-log1p16.0%

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

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

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

        \[\leadsto \color{blue}{b \cdot \left(x \cdot a\right)} \]
    14. Simplified16.8%

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

    if -4.7e14 < y < 4.00000000000000018e42

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.7 \cdot 10^{+14} \lor \neg \left(y \leq 4 \cdot 10^{+42}\right):\\ \;\;\;\;b \cdot \left(x \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 16: 22.3% accurate, 44.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.1 \cdot 10^{+42}:\\
\;\;\;\;x\\

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


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

    if 5.0999999999999999e42 < y

    1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(-a\right) \cdot \left(b \cdot x\right)\right)\right)} \]
      2. expm1-udef36.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(-a\right) \cdot \left(b \cdot x\right)\right)} - 1} \]
      3. add-sqr-sqrt12.3%

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} \cdot \left(b \cdot x\right)\right)} - 1 \]
      7. add-sqr-sqrt32.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{a} \cdot \left(b \cdot x\right)\right)} - 1 \]
      8. associate-*r*32.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(a \cdot b\right) \cdot x}\right)} - 1 \]
    12. Applied egg-rr32.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(a \cdot b\right) \cdot x\right)} - 1} \]
    13. Step-by-step derivation
      1. expm1-def21.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot b\right) \cdot x\right)\right)} \]
      2. expm1-log1p23.8%

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

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

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

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

Alternative 17: 20.4% accurate, 44.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.1 \cdot 10^{-26}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.10000000000000008e-26

    1. Initial program 97.4%

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

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

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

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

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

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

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

    if 2.10000000000000008e-26 < a

    1. Initial program 95.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot e^{y \cdot \left(-t\right)}\right)\right)} \]
      2. expm1-udef41.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(x \cdot e^{y \cdot \left(-t\right)}\right)} - 1} \]
      3. *-commutative41.8%

        \[\leadsto e^{\mathsf{log1p}\left(x \cdot e^{\color{blue}{\left(-t\right) \cdot y}}\right)} - 1 \]
      4. exp-prod40.4%

        \[\leadsto e^{\mathsf{log1p}\left(x \cdot \color{blue}{{\left(e^{-t}\right)}^{y}}\right)} - 1 \]
      5. add-sqr-sqrt24.7%

        \[\leadsto e^{\mathsf{log1p}\left(x \cdot {\left(e^{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}\right)}^{y}\right)} - 1 \]
      6. sqrt-unprod45.6%

        \[\leadsto e^{\mathsf{log1p}\left(x \cdot {\left(e^{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}\right)}^{y}\right)} - 1 \]
      7. sqr-neg45.6%

        \[\leadsto e^{\mathsf{log1p}\left(x \cdot {\left(e^{\sqrt{\color{blue}{t \cdot t}}}\right)}^{y}\right)} - 1 \]
      8. sqrt-unprod20.9%

        \[\leadsto e^{\mathsf{log1p}\left(x \cdot {\left(e^{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}\right)}^{y}\right)} - 1 \]
      9. add-sqr-sqrt32.9%

        \[\leadsto e^{\mathsf{log1p}\left(x \cdot {\left(e^{\color{blue}{t}}\right)}^{y}\right)} - 1 \]
    6. Applied egg-rr32.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(x \cdot {\left(e^{t}\right)}^{y}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def19.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot {\left(e^{t}\right)}^{y}\right)\right)} \]
      2. expm1-log1p23.8%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(x \cdot t\right)} \]
    12. Simplified19.9%

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

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

Alternative 18: 19.2% 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 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 59.6%

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

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

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

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

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

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

    \[\leadsto x \]

Reproduce

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