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

Percentage Accurate: 96.5% → 99.6%
Time: 27.6s
Alternatives: 17
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 96.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.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 94.2%

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

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

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

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

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

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

    \[\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.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+268}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.0000000000000002e268

    1. Initial program 17.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 34.4%

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

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    5. Taylor expanded in z around 0 100.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*100.0%

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

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

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

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

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

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

    if -5.0000000000000002e268 < a

    1. Initial program 96.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.1%

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

Alternative 3: 86.9% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+18} \lor \neg \left(y \leq 4.5\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.45e18 or 4.5 < 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 y around inf 87.3%

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

    if -1.45e18 < y < 4.5

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 72.5% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{+15} \lor \neg \left(a \leq 1.1 \cdot 10^{-105}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9e15 or 1.10000000000000002e-105 < a

    1. Initial program 90.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 67.8%

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

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    5. Taylor expanded in z around 0 79.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*79.9%

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

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

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

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

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

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

    if -1.9e15 < a < 1.10000000000000002e-105

    1. Initial program 100.0%

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

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

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

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

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

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

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

Alternative 5: 50.0% accurate, 2.9× speedup?

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

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

\mathbf{elif}\;y \leq 5.8 \cdot 10^{-304}:\\
\;\;\;\;\left(x \cdot \left(z \cdot z\right)\right) \cdot \left(a \cdot -0.5\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.5e19 or 3.04999999999999986e-15 < y

    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 inf 85.7%

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

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

    if -4.5e19 < y < 5.8e-304

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(a \cdot x\right) \cdot \left(\log \left(1 - z\right) - b\right)} + x \]
      3. fma-def22.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot x, \log \left(1 - z\right) - b, x\right)} \]
      4. sub-neg22.5%

        \[\leadsto \mathsf{fma}\left(a \cdot x, \log \color{blue}{\left(1 + \left(-z\right)\right)} - b, x\right) \]
      5. log1p-def23.9%

        \[\leadsto \mathsf{fma}\left(a \cdot x, \color{blue}{\mathsf{log1p}\left(-z\right)} - b, x\right) \]
    7. Simplified23.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot x, \mathsf{log1p}\left(-z\right) - b, x\right)} \]
    8. Taylor expanded in z around 0 23.8%

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

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

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

        \[\leadsto x + \left(\left(\color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} + -1 \cdot \left(a \cdot \left(x \cdot z\right)\right)\right) + -0.5 \cdot \left(a \cdot \left(x \cdot {z}^{2}\right)\right)\right) \]
      4. distribute-lft-out23.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-0.5 \cdot a\right) \cdot \left(x \cdot {z}^{2}\right)} \]
      2. *-commutative37.6%

        \[\leadsto \color{blue}{\left(x \cdot {z}^{2}\right) \cdot \left(-0.5 \cdot a\right)} \]
      3. unpow237.6%

        \[\leadsto \left(x \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot \left(-0.5 \cdot a\right) \]
      4. *-commutative37.6%

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

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

    if 5.8e-304 < y < 3.04999999999999986e-15

    1. Initial program 91.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 0 81.7%

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

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    5. Taylor expanded in z around 0 90.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*90.4%

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

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{\left(-a\right) \cdot \left(b + z\right)}} \]
    8. Taylor expanded in a around 0 51.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-neg51.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{+19}:\\ \;\;\;\;x \cdot {z}^{y}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-304}:\\ \;\;\;\;\left(x \cdot \left(z \cdot z\right)\right) \cdot \left(a \cdot -0.5\right)\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{-15}:\\ \;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot {z}^{y}\\ \end{array} \]

Alternative 6: 73.9% accurate, 2.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2e24 or 0.69999999999999996 < y

    1. Initial program 95.6%

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

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

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

    if -2e24 < y < 0.69999999999999996

    1. Initial program 93.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 74.7%

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

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

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

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

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

Alternative 7: 72.2% accurate, 2.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.4 \cdot 10^{+47} \lor \neg \left(t \leq 1.45 \cdot 10^{-74}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.39999999999999928e47 or 1.45e-74 < t

    1. Initial program 94.6%

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

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

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

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

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

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

    if -9.39999999999999928e47 < t < 1.45e-74

    1. Initial program 93.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 70.8%

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

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

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

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

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

Alternative 8: 24.4% accurate, 22.1× speedup?

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

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

\mathbf{elif}\;y \leq -4.6 \cdot 10^{-217}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;y \leq 5 \cdot 10^{+19}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.60000000000000023e-4 or 5e19 < y

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.60000000000000023e-4 < y < -4.6000000000000001e-217 or 5.50000000000000035e-304 < y < 5e19

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

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

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

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

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

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

    if -4.6000000000000001e-217 < y < 5.50000000000000035e-304

    1. Initial program 91.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 18.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(-t\right) \cdot \left(y \cdot x\right)} \]
    8. Step-by-step derivation
      1. distribute-lft-neg-out5.1%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(\left(-t\right) \cdot y\right) \cdot x} \]
      9. add-sqr-sqrt2.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.00036:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{-217}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-304}:\\ \;\;\;\;-x \cdot \left(y \cdot t\right)\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+19}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \end{array} \]

Alternative 9: 23.3% accurate, 22.1× speedup?

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

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

\mathbf{elif}\;a \leq 1.35 \cdot 10^{-291}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-191}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 5.1 \cdot 10^{+42}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.79999999999999968e-40 or 1.34999999999999996e-291 < a < 9.4999999999999996e-191

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.79999999999999968e-40 < a < 1.34999999999999996e-291 or 9.4999999999999996e-191 < a < 5.0999999999999999e42

    1. Initial program 100.0%

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

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

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

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

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

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

    if 5.0999999999999999e42 < a

    1. Initial program 91.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 39.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(-t\right) \cdot \left(y \cdot x\right)} \]
    8. Step-by-step derivation
      1. distribute-lft-neg-out18.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \left(\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}} \cdot y\right) \cdot x \]
      11. sqr-neg13.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{-40}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{-291}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-191}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;a \leq 5.1 \cdot 10^{+42}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\ \end{array} \]

Alternative 10: 23.9% accurate, 22.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00042:\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\

\mathbf{elif}\;y \leq -8.5 \cdot 10^{-159}:\\
\;\;\;\;x\\

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

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

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


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

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2000000000000002e-4 < y < -8.4999999999999998e-159 or 5.50000000000000035e-304 < y < 3.4e10

    1. Initial program 93.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 76.5%

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

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

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

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

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

    if -8.4999999999999998e-159 < y < 5.50000000000000035e-304

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(-t\right) \cdot \left(y \cdot x\right)} \]
    8. Step-by-step derivation
      1. distribute-lft-neg-out13.2%

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(\left(-t\right) \cdot y\right) \cdot x} \]
      9. add-sqr-sqrt8.0%

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

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

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

        \[\leadsto x - \left(\color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \cdot y\right) \cdot x \]
      13. add-sqr-sqrt12.9%

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

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

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

    if 3.4e10 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.00042:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-159}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-304}:\\ \;\;\;\;\left(-t\right) \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 34000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]

Alternative 11: 33.1% accurate, 24.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{-304} \lor \neg \left(y \leq 2.4 \cdot 10^{-62}\right):\\
\;\;\;\;\left(x \cdot \left(z \cdot z\right)\right) \cdot \left(a \cdot -0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 6.0000000000000002e-304 or 2.39999999999999984e-62 < y

    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 y around 0 53.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot x, \log \left(1 - z\right) - b, x\right)} \]
      4. sub-neg15.6%

        \[\leadsto \mathsf{fma}\left(a \cdot x, \log \color{blue}{\left(1 + \left(-z\right)\right)} - b, x\right) \]
      5. log1p-def17.2%

        \[\leadsto \mathsf{fma}\left(a \cdot x, \color{blue}{\mathsf{log1p}\left(-z\right)} - b, x\right) \]
    7. Simplified17.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot x, \mathsf{log1p}\left(-z\right) - b, x\right)} \]
    8. Taylor expanded in z around 0 16.7%

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

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

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

        \[\leadsto x + \left(\left(\color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} + -1 \cdot \left(a \cdot \left(x \cdot z\right)\right)\right) + -0.5 \cdot \left(a \cdot \left(x \cdot {z}^{2}\right)\right)\right) \]
      4. distribute-lft-out16.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-0.5 \cdot a\right) \cdot \left(x \cdot {z}^{2}\right)} \]
      2. *-commutative39.2%

        \[\leadsto \color{blue}{\left(x \cdot {z}^{2}\right) \cdot \left(-0.5 \cdot a\right)} \]
      3. unpow239.2%

        \[\leadsto \left(x \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot \left(-0.5 \cdot a\right) \]
      4. *-commutative39.2%

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

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

    if 6.0000000000000002e-304 < y < 2.39999999999999984e-62

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6 \cdot 10^{-304} \lor \neg \left(y \leq 2.4 \cdot 10^{-62}\right):\\ \;\;\;\;\left(x \cdot \left(z \cdot z\right)\right) \cdot \left(a \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \left(x \cdot b\right)\\ \end{array} \]

Alternative 12: 33.6% accurate, 24.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.6 \cdot 10^{-304} \lor \neg \left(y \leq 1.1 \cdot 10^{-49}\right):\\
\;\;\;\;\left(x \cdot \left(z \cdot z\right)\right) \cdot \left(a \cdot -0.5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 5.5999999999999997e-304 or 1.09999999999999995e-49 < y

    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 y around 0 53.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot x, \log \left(1 - z\right) - b, x\right)} \]
      4. sub-neg15.1%

        \[\leadsto \mathsf{fma}\left(a \cdot x, \log \color{blue}{\left(1 + \left(-z\right)\right)} - b, x\right) \]
      5. log1p-def16.6%

        \[\leadsto \mathsf{fma}\left(a \cdot x, \color{blue}{\mathsf{log1p}\left(-z\right)} - b, x\right) \]
    7. Simplified16.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot x, \mathsf{log1p}\left(-z\right) - b, x\right)} \]
    8. Taylor expanded in z around 0 16.0%

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

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

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

        \[\leadsto x + \left(\left(\color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right)\right)} + -1 \cdot \left(a \cdot \left(x \cdot z\right)\right)\right) + -0.5 \cdot \left(a \cdot \left(x \cdot {z}^{2}\right)\right)\right) \]
      4. distribute-lft-out16.0%

        \[\leadsto x + \left(\color{blue}{-1 \cdot \left(a \cdot \left(b \cdot x\right) + a \cdot \left(x \cdot z\right)\right)} + -0.5 \cdot \left(a \cdot \left(x \cdot {z}^{2}\right)\right)\right) \]
      5. distribute-lft-in16.6%

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

        \[\leadsto x + \left(-1 \cdot \left(a \cdot \left(\color{blue}{x \cdot b} + x \cdot z\right)\right) + -0.5 \cdot \left(a \cdot \left(x \cdot {z}^{2}\right)\right)\right) \]
      7. distribute-lft-in16.6%

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

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

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

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

        \[\leadsto \color{blue}{\left(-0.5 \cdot a\right) \cdot \left(x \cdot {z}^{2}\right)} \]
      2. *-commutative39.2%

        \[\leadsto \color{blue}{\left(x \cdot {z}^{2}\right) \cdot \left(-0.5 \cdot a\right)} \]
      3. unpow239.2%

        \[\leadsto \left(x \cdot \color{blue}{\left(z \cdot z\right)}\right) \cdot \left(-0.5 \cdot a\right) \]
      4. *-commutative39.2%

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

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

    if 5.5999999999999997e-304 < y < 1.09999999999999995e-49

    1. Initial program 91.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 81.2%

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

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

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

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

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

      \[\leadsto x \cdot e^{\color{blue}{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}} \]
    5. Taylor expanded in z around 0 89.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*89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 26.6% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0019 \lor \neg \left(y \leq 5 \cdot 10^{+19}\right):\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.0019 or 5e19 < y

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0019 < y < 5e19

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

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

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

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

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

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

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

Alternative 14: 19.1% accurate, 31.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-137}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.7 \cdot 10^{-94}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\

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


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

    1. Initial program 93.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 61.8%

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

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

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

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

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

    if -2.2000000000000001e-137 < x < 1.6999999999999999e-94

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6999999999999999e-94 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \cdot \left(y \cdot x\right) \]
      7. add-sqr-sqrt13.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 31.4% accurate, 34.8× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if 3.4e10 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 31.4% accurate, 34.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 35000000000:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\

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


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

    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 y around 0 67.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot x, \log \left(1 - z\right) - b, x\right)} \]
      4. sub-neg29.0%

        \[\leadsto \mathsf{fma}\left(a \cdot x, \log \color{blue}{\left(1 + \left(-z\right)\right)} - b, x\right) \]
      5. log1p-def31.2%

        \[\leadsto \mathsf{fma}\left(a \cdot x, \color{blue}{\mathsf{log1p}\left(-z\right)} - b, x\right) \]
    7. Simplified31.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot x, \mathsf{log1p}\left(-z\right) - b, x\right)} \]
    8. Taylor expanded in z around 0 30.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5e10 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 35000000000:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]

Alternative 17: 19.1% 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 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 58.7%

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification17.5%

    \[\leadsto x \]

Reproduce

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