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

Percentage Accurate: 96.6% → 99.6%
Time: 20.1s
Alternatives: 18
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 18 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

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

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

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

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

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

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

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

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

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

Alternative 2: 96.6% 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.4%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Final simplification95.4%

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

Alternative 3: 87.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -48000000000000 \lor \neg \left(y \leq 8.4 \cdot 10^{-35}\right):\\ \;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -48000000000000.0) (not (<= y 8.4e-35)))
   (* 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 <= -48000000000000.0) || !(y <= 8.4e-35)) {
		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 <= (-48000000000000.0d0)) .or. (.not. (y <= 8.4d-35))) 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 <= -48000000000000.0) || !(y <= 8.4e-35)) {
		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 <= -48000000000000.0) or not (y <= 8.4e-35):
		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 <= -48000000000000.0) || !(y <= 8.4e-35))
		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 <= -48000000000000.0) || ~((y <= 8.4e-35)))
		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, -48000000000000.0], N[Not[LessEqual[y, 8.4e-35]], $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 -48000000000000 \lor \neg \left(y \leq 8.4 \cdot 10^{-35}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.8e13 or 8.3999999999999999e-35 < 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. Taylor expanded in y around inf 91.7%

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

    if -4.8e13 < y < 8.3999999999999999e-35

    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. Taylor expanded in y around 0 81.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 70.6% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{t \cdot \left(-y\right)}\\ t_2 := x \cdot {z}^{y}\\ \mathbf{if}\;y \leq -1.55 \cdot 10^{+171}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{+87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -66000000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-33}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+191} \lor \neg \left(y \leq 2 \cdot 10^{+248}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (exp (* t (- y))))) (t_2 (* x (pow z y))))
   (if (<= y -1.55e+171)
     t_2
     (if (<= y -7.5e+87)
       t_1
       (if (<= y -66000000000000.0)
         t_2
         (if (<= y 5.2e-33)
           (* x (exp (* a (- b))))
           (if (or (<= y 5.5e+191) (not (<= y 2e+248))) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * exp((t * -y));
	double t_2 = x * pow(z, y);
	double tmp;
	if (y <= -1.55e+171) {
		tmp = t_2;
	} else if (y <= -7.5e+87) {
		tmp = t_1;
	} else if (y <= -66000000000000.0) {
		tmp = t_2;
	} else if (y <= 5.2e-33) {
		tmp = x * exp((a * -b));
	} else if ((y <= 5.5e+191) || !(y <= 2e+248)) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * exp((t * -y))
    t_2 = x * (z ** y)
    if (y <= (-1.55d+171)) then
        tmp = t_2
    else if (y <= (-7.5d+87)) then
        tmp = t_1
    else if (y <= (-66000000000000.0d0)) then
        tmp = t_2
    else if (y <= 5.2d-33) then
        tmp = x * exp((a * -b))
    else if ((y <= 5.5d+191) .or. (.not. (y <= 2d+248))) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * Math.exp((t * -y));
	double t_2 = x * Math.pow(z, y);
	double tmp;
	if (y <= -1.55e+171) {
		tmp = t_2;
	} else if (y <= -7.5e+87) {
		tmp = t_1;
	} else if (y <= -66000000000000.0) {
		tmp = t_2;
	} else if (y <= 5.2e-33) {
		tmp = x * Math.exp((a * -b));
	} else if ((y <= 5.5e+191) || !(y <= 2e+248)) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * math.exp((t * -y))
	t_2 = x * math.pow(z, y)
	tmp = 0
	if y <= -1.55e+171:
		tmp = t_2
	elif y <= -7.5e+87:
		tmp = t_1
	elif y <= -66000000000000.0:
		tmp = t_2
	elif y <= 5.2e-33:
		tmp = x * math.exp((a * -b))
	elif (y <= 5.5e+191) or not (y <= 2e+248):
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * exp(Float64(t * Float64(-y))))
	t_2 = Float64(x * (z ^ y))
	tmp = 0.0
	if (y <= -1.55e+171)
		tmp = t_2;
	elseif (y <= -7.5e+87)
		tmp = t_1;
	elseif (y <= -66000000000000.0)
		tmp = t_2;
	elseif (y <= 5.2e-33)
		tmp = Float64(x * exp(Float64(a * Float64(-b))));
	elseif ((y <= 5.5e+191) || !(y <= 2e+248))
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * exp((t * -y));
	t_2 = x * (z ^ y);
	tmp = 0.0;
	if (y <= -1.55e+171)
		tmp = t_2;
	elseif (y <= -7.5e+87)
		tmp = t_1;
	elseif (y <= -66000000000000.0)
		tmp = t_2;
	elseif (y <= 5.2e-33)
		tmp = x * exp((a * -b));
	elseif ((y <= 5.5e+191) || ~((y <= 2e+248)))
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e+171], t$95$2, If[LessEqual[y, -7.5e+87], t$95$1, If[LessEqual[y, -66000000000000.0], t$95$2, If[LessEqual[y, 5.2e-33], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 5.5e+191], N[Not[LessEqual[y, 2e+248]], $MachinePrecision]], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -7.5 \cdot 10^{+87}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -66000000000000:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 5.5 \cdot 10^{+191} \lor \neg \left(y \leq 2 \cdot 10^{+248}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.5499999999999999e171 or -7.50000000000000014e87 < y < -6.6e13 or 5.5000000000000002e191 < y < 2.00000000000000009e248

    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. Taylor expanded in y around inf 88.4%

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

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

    if -1.5499999999999999e171 < y < -7.50000000000000014e87 or 5.19999999999999988e-33 < y < 5.5000000000000002e191 or 2.00000000000000009e248 < y

    1. Initial program 95.0%

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

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

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

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

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

    if -6.6e13 < y < 5.19999999999999988e-33

    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. Taylor expanded in b around inf 81.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{+171}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{+87}:\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{elif}\;y \leq -66000000000000:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-33}:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+191} \lor \neg \left(y \leq 2 \cdot 10^{+248}\right):\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 5: 72.2% accurate, 2.8× speedup?

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

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

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

\mathbf{elif}\;y \leq 7.6 \cdot 10^{+125} \lor \neg \left(y \leq 5 \cdot 10^{+194}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9e14 or 3800 < y < 7.60000000000000003e125 or 4.99999999999999989e194 < y

    1. Initial program 96.5%

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

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

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

    if -9e14 < y < 3800

    1. Initial program 94.9%

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

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

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

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

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

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

    if 7.60000000000000003e125 < y < 4.99999999999999989e194

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left({t}^{2} \cdot \left(x \cdot {y}^{2}\right)\right)} \]
    9. Step-by-step derivation
      1. unpow277.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+14}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 3800:\\ \;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{+125} \lor \neg \left(y \leq 5 \cdot 10^{+194}\right):\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot \left(t \cdot 0.5\right)\right)\\ \end{array} \]

Alternative 6: 75.2% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+42} \lor \neg \left(t \leq 2.5 \cdot 10^{+45}\right):\\ \;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= t -1.2e+42) (not (<= t 2.5e+45)))
   (* 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 <= -1.2e+42) || !(t <= 2.5e+45)) {
		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 <= (-1.2d+42)) .or. (.not. (t <= 2.5d+45))) 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 <= -1.2e+42) || !(t <= 2.5e+45)) {
		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 <= -1.2e+42) or not (t <= 2.5e+45):
		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 <= -1.2e+42) || !(t <= 2.5e+45))
		tmp = Float64(x * exp(Float64(t * Float64(-y))));
	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 ((t <= -1.2e+42) || ~((t <= 2.5e+45)))
		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, -1.2e+42], N[Not[LessEqual[t, 2.5e+45]], $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 -1.2 \cdot 10^{+42} \lor \neg \left(t \leq 2.5 \cdot 10^{+45}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.1999999999999999e42 or 2.5e45 < t

    1. Initial program 94.9%

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

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

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

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

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

    if -1.1999999999999999e42 < t < 2.5e45

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 57.8% accurate, 3.0× speedup?

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

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

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


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

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -550 < 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. Taylor expanded in y around inf 65.8%

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

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

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

Alternative 8: 41.8% accurate, 14.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-100} \lor \neg \left(y \leq 2.4 \cdot 10^{-36}\right):\\
\;\;\;\;\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot \left(t \cdot 0.5\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.09999999999999995e-100 or 2.4e-36 < y

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\left(1 - y \cdot t\right) + \color{blue}{\left(0.5 \cdot {t}^{2}\right) \cdot {y}^{2}}\right) \]
      6. unpow234.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot {y}^{2}\right) \cdot \left(0.5 \cdot \left(t \cdot t\right)\right)} \]
      4. unpow239.5%

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

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

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

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

    if -1.09999999999999995e-100 < y < 2.4e-36

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\left(1 - a \cdot b\right) + 0.5 \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
      6. unswap-sqr52.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.1 \cdot 10^{-100} \lor \neg \left(y \leq 2.4 \cdot 10^{-36}\right):\\ \;\;\;\;\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot \left(t \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(1 - a \cdot b\right) + 0.5 \cdot \left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right)\right)\\ \end{array} \]

Alternative 9: 39.2% accurate, 20.8× speedup?

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

\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 < -2.7000000000000001e-112 or 1.5000000000000001e-36 < y

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\left(1 - y \cdot t\right) + \color{blue}{\left(0.5 \cdot {t}^{2}\right) \cdot {y}^{2}}\right) \]
      6. unpow234.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x \cdot {y}^{2}\right) \cdot \left(0.5 \cdot \left(t \cdot t\right)\right)} \]
      4. unpow239.5%

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

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

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

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

    if -2.7000000000000001e-112 < y < 1.5000000000000001e-36

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-112} \lor \neg \left(y \leq 1.5 \cdot 10^{-36}\right):\\ \;\;\;\;\left(x \cdot \left(y \cdot y\right)\right) \cdot \left(t \cdot \left(t \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \end{array} \]

Alternative 10: 32.8% accurate, 24.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+72} \lor \neg \left(t \leq 11000000000000\right):\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

\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 t < -1.65e72 or 1.1e13 < t

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

    if -1.65e72 < t < 1.1e13

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.65 \cdot 10^{+72} \lor \neg \left(t \leq 11000000000000\right):\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\ \end{array} \]

Alternative 11: 22.9% accurate, 25.8× speedup?

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

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

\mathbf{elif}\;b \leq -6.2 \cdot 10^{-106} \lor \neg \left(b \leq 1.75 \cdot 10^{-19}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -6.8000000000000001e114

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.8000000000000001e114 < b < -6.19999999999999971e-106 or 1.75000000000000008e-19 < b

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(x \cdot z\right) \]
    13. Simplified26.6%

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

    if -6.19999999999999971e-106 < b < 1.75000000000000008e-19

    1. Initial program 93.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.8 \cdot 10^{+114}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-106} \lor \neg \left(b \leq 1.75 \cdot 10^{-19}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 12: 30.2% accurate, 28.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{-42} \lor \neg \left(x \leq 9.8 \cdot 10^{-80}\right):\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.5500000000000001e-42 or 9.79999999999999981e-80 < x

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

    if -1.5500000000000001e-42 < x < 9.79999999999999981e-80

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - a \cdot \color{blue}{\left(\left(b + z\right) \cdot x\right)} \]
    10. Simplified15.4%

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

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

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

        \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(x \cdot z\right) \]
    13. Simplified33.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.55 \cdot 10^{-42} \lor \neg \left(x \leq 9.8 \cdot 10^{-80}\right):\\ \;\;\;\;x \cdot \left(1 - a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \end{array} \]

Alternative 13: 32.4% accurate, 28.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.29999999999999991e72 or 1.25e12 < t

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

    if -1.29999999999999991e72 < t < 1.25e12

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 31.7% accurate, 28.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+68} \lor \neg \left(t \leq 5.1 \cdot 10^{-8}\right):\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5000000000000002e68 or 5.10000000000000001e-8 < t

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

    if -2.5000000000000002e68 < t < 5.10000000000000001e-8

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.5 \cdot 10^{+68} \lor \neg \left(t \leq 5.1 \cdot 10^{-8}\right):\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x - b \cdot \left(x \cdot a\right)\\ \end{array} \]

Alternative 15: 26.7% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-82} \lor \neg \left(y \leq 1.06 \cdot 10^{-70}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.30000000000000022e-82 or 1.06e-70 < y

    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. Taylor expanded in b around inf 38.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.30000000000000022e-82 < y < 1.06e-70

    1. Initial program 95.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{-82} \lor \neg \left(y \leq 1.06 \cdot 10^{-70}\right):\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 16: 26.6% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-83}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{-70}:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-a\right)} \cdot \left(x \cdot z\right) \]
    13. Simplified18.0%

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

    if -3.09999999999999992e-83 < y < 1.3500000000000001e-70

    1. Initial program 94.8%

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

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

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

    if 1.3500000000000001e-70 < y

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{-83}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-70}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \end{array} \]

Alternative 17: 18.8% accurate, 44.6× speedup?

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

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

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


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

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999939e-99 < b

    1. Initial program 93.9%

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

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

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

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

Alternative 18: 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.4%

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

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification16.6%

    \[\leadsto x \]

Reproduce

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