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

Percentage Accurate: 96.4% → 99.7%
Time: 17.3s
Alternatives: 16
Speedup: 1.5×

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

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

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

Alternative 1: 99.7% accurate, 0.8× speedup?

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

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

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

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

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

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

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

Alternative 2: 83.3% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{+48} \lor \neg \left(a \leq 4.9 \cdot 10^{+98}\right):\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.00000000000000018e48 or 4.89999999999999979e98 < a

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000018e48 < a < 4.89999999999999979e98

    1. Initial program 99.9%

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

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

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

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

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

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

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

Alternative 3: 99.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (- (* y (- (log z) t)) (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) - (a * (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 * (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 * (z + b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) - (a * (z + b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * Float64(z + b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) - (a * (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[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}
\end{array}
Derivation
  1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

Alternative 4: 73.3% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{+31} \lor \neg \left(a \leq 8.2 \cdot 10^{+37}\right):\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.3e31 or 8.1999999999999996e37 < a

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3e31 < a < 8.1999999999999996e37

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.4% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+33} \lor \neg \left(a \leq 3.4 \cdot 10^{+55}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.34999999999999996e33 or 3.3999999999999998e55 < a

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

    if -1.34999999999999996e33 < a < 3.3999999999999998e55

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 71.1% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -145000000 \lor \neg \left(t \leq 2 \cdot 10^{-30}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\

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


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

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1.45e8 < t < 2e-30

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

Alternative 7: 52.0% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-15} \lor \neg \left(y \leq 2.25 \cdot 10^{-20}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.14999999999999995e-15 or 2.2500000000000001e-20 < y

    1. Initial program 99.1%

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

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

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

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

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

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

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

    if -1.14999999999999995e-15 < y < 2.2500000000000001e-20

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(a \cdot x\right) \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \]
    8. Simplified38.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot \left(-1 \cdot \left(b \cdot x\right) + \frac{x}{a}\right)} \]
    13. Step-by-step derivation
      1. +-commutative46.0%

        \[\leadsto a \cdot \color{blue}{\left(\frac{x}{a} + -1 \cdot \left(b \cdot x\right)\right)} \]
      2. mul-1-neg46.0%

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

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

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

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

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

Alternative 8: 27.3% accurate, 13.1× speedup?

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

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

\mathbf{elif}\;t \leq -1.6 \cdot 10^{+27}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{+234}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\

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


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

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5500000000000001e217 < t < -1.60000000000000008e27

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(a \cdot x\right) \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \]
    8. Simplified11.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.60000000000000008e27 < t < 1.3500000000000001e234

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(a \cdot x\right) \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \]
    8. Simplified32.9%

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(\frac{x}{a} + -1 \cdot \left(b \cdot x\right)\right)} \]
      2. mul-1-neg40.4%

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

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

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

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

    if 1.3500000000000001e234 < t

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.55 \cdot 10^{+217}:\\ \;\;\;\;t \cdot \left(\frac{x}{t} - x \cdot y\right)\\ \mathbf{elif}\;t \leq -1.6 \cdot 10^{+27}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+234}:\\ \;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\frac{x}{y} - x \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 27.6% accurate, 13.1× speedup?

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

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

\mathbf{elif}\;t \leq -5.5 \cdot 10^{+35}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

\mathbf{elif}\;t \leq 2.5 \cdot 10^{+236}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\

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


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

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e219 < t < -5.50000000000000001e35

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(a \cdot x\right) \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \]
    8. Simplified11.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000001e35 < t < 2.49999999999999985e236

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(a \cdot x\right) \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \]
    8. Simplified32.9%

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(\frac{x}{a} + -1 \cdot \left(b \cdot x\right)\right)} \]
      2. mul-1-neg40.4%

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

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

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

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

    if 2.49999999999999985e236 < t

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 27.5% accurate, 13.1× speedup?

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

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

\mathbf{elif}\;t \leq -5.2 \cdot 10^{+35}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

\mathbf{elif}\;t \leq 1.05 \cdot 10^{+234}:\\
\;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\

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


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

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.6000000000000004e222 < t < -5.20000000000000013e35

    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. Step-by-step derivation
      1. fma-define95.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(a \cdot x\right) \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \]
    8. Simplified12.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.20000000000000013e35 < t < 1.05e234

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(a \cdot x\right) \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \]
    8. Simplified32.9%

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

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(\frac{x}{a} + -1 \cdot \left(b \cdot x\right)\right)} \]
      2. mul-1-neg40.4%

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

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

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

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

    if 1.05e234 < t

    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. Step-by-step derivation
      1. fma-define100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.6 \cdot 10^{+222}:\\ \;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\ \mathbf{elif}\;t \leq -5.2 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+234}:\\ \;\;\;\;a \cdot \left(\frac{x}{a} - x \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 30.2% accurate, 18.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.08000000000000001e-7

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-b \cdot x\right) \cdot a} \]
      4. distribute-lft-neg-out26.2%

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

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

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

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

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

    if -1.08000000000000001e-7 < a < 3.2000000000000001e31

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000001e31 < a

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.08 \cdot 10^{-7}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+31}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 29.3% accurate, 18.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.7999999999999994e-8

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-a\right) \cdot \color{blue}{\left(x \cdot b\right)} \]
      4. cancel-sign-sub-inv26.2%

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

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

    if -8.7999999999999994e-8 < a < 3.2000000000000001e31

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000001e31 < a

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.8 \cdot 10^{-8}:\\ \;\;\;\;x - a \cdot \left(x \cdot b\right)\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+31}:\\ \;\;\;\;x \cdot \left(1 - y \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 29.1% accurate, 18.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.2e7

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.2e7 < a < 3.2000000000000001e31

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000001e31 < a

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 24.2% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+26} \lor \neg \left(a \leq 3.2 \cdot 10^{+31}\right):\\
\;\;\;\;-x \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.40000000000000005e26 or 3.2000000000000001e31 < a

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(a \cdot x\right) \cdot \left(\mathsf{log1p}\left(\color{blue}{-z}\right) - b\right) \]
    8. Simplified26.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.40000000000000005e26 < a < 3.2000000000000001e31

    1. Initial program 99.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.4 \cdot 10^{+26} \lor \neg \left(a \leq 3.2 \cdot 10^{+31}\right):\\ \;\;\;\;-x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 24.5% accurate, 19.6× speedup?

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

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

\mathbf{elif}\;a \leq 3.2 \cdot 10^{+31}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.9499999999999999e28

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9499999999999999e28 < a < 3.2000000000000001e31

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if 3.2000000000000001e31 < a

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.95 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+31}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 18.3% 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 98.4%

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

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

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

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

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

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

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

Reproduce

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