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

Percentage Accurate: 96.7% → 99.6%
Time: 13.7s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 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.6% accurate, 0.8× speedup?

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

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

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Step-by-step derivation
    1. fma-def98.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-neg98.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. Add Preprocessing
  5. 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)} \]
  6. Add Preprocessing

Alternative 2: 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}
Derivation
  1. Initial program 97.6%

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

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

Alternative 3: 80.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{+102} \lor \neg \left(b \leq 6.5 \cdot 10^{+113}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -8.8000000000000003e102 or 6.5000000000000001e113 < b

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

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

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

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

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

    if -8.8000000000000003e102 < b < 6.5000000000000001e113

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

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

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

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

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

        \[\leadsto x \cdot \frac{e^{e^{\color{blue}{\log \left(1 + y \cdot \left(\log z - t\right)\right)}}}}{e^{1}} \]
      5. rem-exp-log86.9%

        \[\leadsto x \cdot \frac{e^{\color{blue}{1 + y \cdot \left(\log z - t\right)}}}{e^{1}} \]
      6. +-commutative86.9%

        \[\leadsto x \cdot \frac{e^{\color{blue}{y \cdot \left(\log z - t\right) + 1}}}{e^{1}} \]
    5. Applied egg-rr86.9%

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

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

Alternative 4: 80.5% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.6 \cdot 10^{+102} \lor \neg \left(b \leq 4.5 \cdot 10^{+114}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -8.6000000000000002e102 or 4.5000000000000001e114 < b

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

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

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

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

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

    if -8.6000000000000002e102 < b < 4.5000000000000001e114

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

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

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

Alternative 5: 74.6% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+69} \lor \neg \left(t \leq 520000000\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\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 t < -3.2999999999999999e69 or 5.2e8 < t

    1. Initial program 95.7%

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

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

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

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

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

    if -3.2999999999999999e69 < t < 5.2e8

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 70.8% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{+18} \lor \neg \left(t \leq 8 \cdot 10^{-71}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.05e18 or 7.9999999999999993e-71 < t

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

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

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

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

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

    if -2.05e18 < t < 7.9999999999999993e-71

    1. Initial program 100.0%

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

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

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

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

Alternative 7: 72.0% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+42} \lor \neg \left(t \leq 360000000\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.8e42 or 3.6e8 < t

    1. Initial program 95.2%

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

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

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

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

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

    if -1.8e42 < t < 3.6e8

    1. Initial program 99.7%

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

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

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

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

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

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

Alternative 8: 54.7% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

    if -4.1e18 < t

    1. Initial program 97.6%

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

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

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

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

Alternative 9: 26.7% accurate, 28.3× speedup?

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

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.49999999999999995e149 < y < 5.55999999999999953e-13

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(t \cdot \left(-y\right)\right)} \cdot x \]
      6. distribute-rgt1-in37.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-y, t, 1\right)} \cdot x \]
      9. add-sqr-sqrt17.9%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}, t, 1\right) \cdot x \]
      10. sqrt-unprod36.5%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}, t, 1\right) \cdot x \]
      11. sqr-neg36.5%

        \[\leadsto \mathsf{fma}\left(\sqrt{\color{blue}{y \cdot y}}, t, 1\right) \cdot x \]
      12. sqrt-unprod19.0%

        \[\leadsto \mathsf{fma}\left(\color{blue}{\sqrt{y} \cdot \sqrt{y}}, t, 1\right) \cdot x \]
      13. add-sqr-sqrt35.8%

        \[\leadsto \mathsf{fma}\left(\color{blue}{y}, t, 1\right) \cdot x \]
    10. Applied egg-rr35.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, t, 1\right) \cdot x} \]
    11. Taylor expanded in y around 0 37.0%

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

    if 5.55999999999999953e-13 < y

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+149}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 5.56 \cdot 10^{-13}:\\ \;\;\;\;x + t \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 26.4% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+149} \lor \neg \left(y \leq 5.56 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.40000000000000012e149 or 5.55999999999999953e-13 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(\left(-y\right) \cdot t\right)} \]
      6. distribute-lft-neg-in29.0%

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

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

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

    if -2.40000000000000012e149 < y < 5.55999999999999953e-13

    1. Initial program 98.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+149} \lor \neg \left(y \leq 5.56 \cdot 10^{-13}\right):\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 26.7% accurate, 31.1× speedup?

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

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

\mathbf{elif}\;y \leq 5.56 \cdot 10^{-13}:\\
\;\;\;\;x\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.40000000000000012e149 < y < 5.55999999999999953e-13

    1. Initial program 98.6%

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

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

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

    if 5.55999999999999953e-13 < y

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+149}:\\ \;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\ \mathbf{elif}\;y \leq 5.56 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 28.6% accurate, 34.8× speedup?

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

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

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


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

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

    if 1.45e13 < y

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 14500000000000:\\ \;\;\;\;x - t \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 27.7% accurate, 45.0× speedup?

\[\begin{array}{l} \\ x \cdot \left(1 - y \cdot t\right) \end{array} \]
(FPCore (x y z t a b) :precision binary64 (* x (- 1.0 (* y t))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * (1.0 - (y * t));
}
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 * (1.0d0 - (y * t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * (1.0 - (y * t));
}
def code(x, y, z, t, a, b):
	return x * (1.0 - (y * t))
function code(x, y, z, t, a, b)
	return Float64(x * Float64(1.0 - Float64(y * t)))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * (1.0 - (y * t));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(1 - y \cdot t\right)
\end{array}
Derivation
  1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot \left(1 - y \cdot t\right) \]
  10. Add Preprocessing

Alternative 14: 18.7% accurate, 315.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification23.1%

    \[\leadsto x \]
  6. Add Preprocessing

Reproduce

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