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

Percentage Accurate: 96.7% → 99.6%
Time: 17.9s
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 95.8%

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

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

      \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \color{blue}{\left(1 + \left(-z\right)\right)} - b\right)\right)} \]
    3. log1p-define99.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. 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 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. Add Preprocessing

Alternative 3: 86.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.14 \cdot 10^{+18} \lor \neg \left(y \leq 170000\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -1.14e+18) (not (<= y 170000.0)))
   (* 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 <= -1.14e+18) || !(y <= 170000.0)) {
		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 <= (-1.14d+18)) .or. (.not. (y <= 170000.0d0))) 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 <= -1.14e+18) || !(y <= 170000.0)) {
		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 <= -1.14e+18) or not (y <= 170000.0):
		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 <= -1.14e+18) || !(y <= 170000.0))
		tmp = Float64(x * exp(Float64(y * Float64(log(z) - t))));
	else
		tmp = Float64(x * exp(Float64(Float64(-a) * Float64(z + b))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -1.14e+18) || ~((y <= 170000.0)))
		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, -1.14e+18], N[Not[LessEqual[y, 170000.0]], $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 -1.14 \cdot 10^{+18} \lor \neg \left(y \leq 170000\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.14e18 or 1.7e5 < y

    1. Initial program 99.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 89.5%

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

    if -1.14e18 < y < 1.7e5

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

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

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

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

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

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

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

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

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

      \[\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*86.4%

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

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

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

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

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

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

Alternative 4: 69.7% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{if}\;b \leq -1.8 \cdot 10^{-43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2 \cdot 10^{-300}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{+95}:\\ \;\;\;\;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 (exp (* a (- b))))))
   (if (<= b -1.8e-43)
     t_1
     (if (<= b 2e-300)
       (* x (pow z y))
       (if (<= b 2.6e+95) (* x (exp (* y (- t)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((a * -b));
	double tmp;
	if (b <= -1.8e-43) {
		tmp = t_1;
	} else if (b <= 2e-300) {
		tmp = x * pow(z, y);
	} else if (b <= 2.6e+95) {
		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 * exp((a * -b))
    if (b <= (-1.8d-43)) then
        tmp = t_1
    else if (b <= 2d-300) then
        tmp = x * (z ** y)
    else if (b <= 2.6d+95) 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.exp((a * -b));
	double tmp;
	if (b <= -1.8e-43) {
		tmp = t_1;
	} else if (b <= 2e-300) {
		tmp = x * Math.pow(z, y);
	} else if (b <= 2.6e+95) {
		tmp = x * Math.exp((y * -t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((a * -b))
	tmp = 0
	if b <= -1.8e-43:
		tmp = t_1
	elif b <= 2e-300:
		tmp = x * math.pow(z, y)
	elif b <= 2.6e+95:
		tmp = x * math.exp((y * -t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(a * Float64(-b))))
	tmp = 0.0
	if (b <= -1.8e-43)
		tmp = t_1;
	elseif (b <= 2e-300)
		tmp = Float64(x * (z ^ y));
	elseif (b <= 2.6e+95)
		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 * exp((a * -b));
	tmp = 0.0;
	if (b <= -1.8e-43)
		tmp = t_1;
	elseif (b <= 2e-300)
		tmp = x * (z ^ y);
	elseif (b <= 2.6e+95)
		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[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.8e-43], t$95$1, If[LessEqual[b, 2e-300], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.6e+95], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 2 \cdot 10^{-300}:\\
\;\;\;\;x \cdot {z}^{y}\\

\mathbf{elif}\;b \leq 2.6 \cdot 10^{+95}:\\
\;\;\;\;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 b < -1.7999999999999999e-43 or 2.5999999999999999e95 < b

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

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

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

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

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

    if -1.7999999999999999e-43 < b < 2.00000000000000005e-300

    1. Initial program 90.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 y around inf 85.8%

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

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

    if 2.00000000000000005e-300 < b < 2.5999999999999999e95

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

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

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

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

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

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

Alternative 5: 75.0% accurate, 2.7× speedup?

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

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

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

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


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

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

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

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

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

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

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

    if -2.50000000000000014e62 < y < 175000

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

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

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

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

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

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

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

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

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

      \[\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*82.8%

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

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

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

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

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

    if 175000 < y

    1. Initial program 100.0%

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

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

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

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

Alternative 6: 73.7% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+18} \lor \neg \left(y \leq 140000\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.1e+18) (not (<= y 140000.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.1e+18) || !(y <= 140000.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.1d+18)) .or. (.not. (y <= 140000.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.1e+18) || !(y <= 140000.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.1e+18) or not (y <= 140000.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.1e+18) || !(y <= 140000.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.1e+18) || ~((y <= 140000.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.1e+18], N[Not[LessEqual[y, 140000.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.1 \cdot 10^{+18} \lor \neg \left(y \leq 140000\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.1e18 or 1.4e5 < y

    1. Initial program 99.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 89.5%

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

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

    if -3.1e18 < y < 1.4e5

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

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

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

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

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

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

Alternative 7: 56.9% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-16} \lor \neg \left(y \leq 2.7 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.79999999999999954e-16 or 2.70000000000000005e-11 < y

    1. Initial program 99.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.9%

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

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

    if -7.79999999999999954e-16 < y < 2.70000000000000005e-11

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

      \[\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*85.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{-16} \lor \neg \left(y \leq 2.7 \cdot 10^{-11}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 26.6% accurate, 16.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.15 \cdot 10^{-219}:\\
\;\;\;\;y \cdot \frac{x}{y}\\

\mathbf{elif}\;x \leq 1.12 \cdot 10^{-121}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 1.14999999999999994e-219

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]

    if 1.14999999999999994e-219 < x < 1.12e-121

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.12e-121 < x

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

      \[\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*67.8%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 26.3% accurate, 18.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.15 \cdot 10^{-219}:\\
\;\;\;\;y \cdot \frac{x}{y}\\

\mathbf{elif}\;x \leq 1.6 \cdot 10^{-121}:\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 1.14999999999999994e-219

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]

    if 1.14999999999999994e-219 < x < 1.60000000000000009e-121

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.60000000000000009e-121 < x

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 22.0% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.6 \cdot 10^{-166} \lor \neg \left(z \leq 1.16 \cdot 10^{-66}\right):\\
\;\;\;\;y \cdot \frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 3.6000000000000001e-166 or 1.16000000000000002e-66 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]

    if 3.6000000000000001e-166 < z < 1.16000000000000002e-66

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 3.6 \cdot 10^{-166} \lor \neg \left(z \leq 1.16 \cdot 10^{-66}\right):\\ \;\;\;\;y \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 27.9% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+16} \lor \neg \left(y \leq 7.2 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot \left(y \cdot \left(-t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.6e16 or 7.19999999999999969e-11 < y

    1. Initial program 99.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 60.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e16 < y < 7.19999999999999969e-11

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

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

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

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

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

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

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

Alternative 12: 18.5% accurate, 31.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 9 \cdot 10^{-46}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 9.00000000000000001e-46

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

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

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

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

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

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

    if 9.00000000000000001e-46 < b

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(x \cdot \left(t \cdot \left(-y\right)\right)\right)}^{1}} \]
      2. add-sqr-sqrt7.8%

        \[\leadsto {\left(x \cdot \left(t \cdot \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)}\right)\right)}^{1} \]
      3. sqrt-unprod16.8%

        \[\leadsto {\left(x \cdot \left(t \cdot \color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}\right)\right)}^{1} \]
      4. sqr-neg16.8%

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

        \[\leadsto {\left(x \cdot \left(t \cdot \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)}\right)\right)}^{1} \]
      6. add-sqr-sqrt10.5%

        \[\leadsto {\left(x \cdot \left(t \cdot \color{blue}{y}\right)\right)}^{1} \]
    13. Applied egg-rr10.5%

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

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

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

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

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

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

Alternative 13: 24.0% accurate, 63.0× speedup?

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

\\
y \cdot \frac{x}{y}
\end{array}
Derivation
  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 56.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \left(\frac{x}{y} + \color{blue}{\left(-t \cdot x\right)}\right) \]
    3. sub-neg23.9%

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

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

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

    \[\leadsto y \cdot \color{blue}{\frac{x}{y}} \]
  13. Add Preprocessing

Alternative 14: 19.5% 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 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 b around inf 58.5%

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

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

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

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

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

Reproduce

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