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

Percentage Accurate: 96.3% → 98.9%
Time: 14.1s
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.3% 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: 98.9% 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 97.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 100.0%

    \[\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. associate-*r*100.0%

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

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

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

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

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

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

Alternative 2: 87.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-5} \lor \neg \left(y \leq 1.5 \cdot 10^{-19}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.59999999999999984e-5 or 1.49999999999999996e-19 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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.8%

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

    if -2.59999999999999984e-5 < y < 1.49999999999999996e-19

    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-define95.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-neg95.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 81.1%

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

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

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

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

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

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

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

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

Alternative 3: 76.8% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -50 \lor \neg \left(y \leq 130000000000\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -50 or 1.3e11 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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 91.1%

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

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

    if -50 < y < 1.3e11

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

Alternative 4: 73.8% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.13 \lor \neg \left(y \leq 20000000000\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


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

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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 91.1%

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

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

    if -0.13 < y < 2e10

    1. Initial program 95.7%

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

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

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

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

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

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

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

Alternative 5: 56.8% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{-13} \lor \neg \left(y \leq 1.5 \cdot 10^{-31}\right):\\
\;\;\;\;x \cdot {z}^{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.79999999999999986e-13 or 1.49999999999999991e-31 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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 88.9%

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

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

    if -8.79999999999999986e-13 < y < 1.49999999999999991e-31

    1. Initial program 95.4%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. 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 80.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 22.9% accurate, 15.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.9e-6

    1. Initial program 94.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-define94.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-neg94.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 66.4%

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

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

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

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

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

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

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

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

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

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

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

    if -1.9e-6 < a < 4.90000000000000028e-88

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - a \cdot \left(x \cdot b\right)} \]
    12. Step-by-step derivation
      1. cancel-sign-sub-inv36.9%

        \[\leadsto \color{blue}{x + \left(-a\right) \cdot \left(x \cdot b\right)} \]
      2. add-sqr-sqrt17.9%

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

        \[\leadsto x + \color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}} \cdot \left(x \cdot b\right) \]
      4. sqr-neg35.0%

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

        \[\leadsto x + \color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} \cdot \left(x \cdot b\right) \]
      6. add-sqr-sqrt35.7%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(a \cdot b\right)} + x \]
    13. Applied egg-rr35.8%

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

    if 4.90000000000000028e-88 < a < 7.59999999999999992e219

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.59999999999999992e219 < a

    1. Initial program 94.2%

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

      \[\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. associate-*r*100.0%

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot t\right) \cdot y}} \]
      2. neg-mul-131.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{-6}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \mathbf{elif}\;a \leq 4.9 \cdot 10^{-88}:\\ \;\;\;\;x + x \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+219}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot t\right) \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 23.2% accurate, 15.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.9e-6

    1. Initial program 94.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-define94.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-neg94.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 66.4%

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

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

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

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

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

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

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

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

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

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

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

    if -1.9e-6 < a < 6.50000000000000006e-88

    1. Initial program 100.0%

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

      \[\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. associate-*r*100.0%

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot t\right) \cdot y}} \]
      2. neg-mul-171.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(0 + \color{blue}{t}\right) \cdot \left(x \cdot y\right) \]
    13. Applied egg-rr35.4%

      \[\leadsto x + \color{blue}{\left(0 + t\right)} \cdot \left(x \cdot y\right) \]
    14. Step-by-step derivation
      1. +-lft-identity35.4%

        \[\leadsto x + \color{blue}{t} \cdot \left(x \cdot y\right) \]
    15. Simplified35.4%

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

    if 6.50000000000000006e-88 < a < 1.95e221

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.95e221 < a

    1. Initial program 94.2%

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

      \[\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. associate-*r*100.0%

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot t\right) \cdot y}} \]
      2. neg-mul-131.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.9 \cdot 10^{-6}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-88}:\\ \;\;\;\;x + t \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{+221}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot t\right) \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 23.0% accurate, 15.0× speedup?

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

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

\mathbf{elif}\;a \leq 6 \cdot 10^{-88}:\\
\;\;\;\;x\\

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

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


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

    1. Initial program 94.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-define94.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-neg94.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 66.4%

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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999989e-7 < a < 5.9999999999999999e-88

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

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

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

    if 5.9999999999999999e-88 < a < 2.9999999999999999e215

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9999999999999999e215 < a

    1. Initial program 94.2%

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

      \[\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. associate-*r*100.0%

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot t\right) \cdot y}} \]
      2. neg-mul-131.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 23.6% accurate, 15.0× speedup?

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

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

\mathbf{elif}\;a \leq 4.4 \cdot 10^{-88}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.5999999999999999e-6

    1. Initial program 94.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-define94.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-neg94.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 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5999999999999999e-6 < a < 4.4000000000000001e-88

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

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

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

    if 4.4000000000000001e-88 < a < 1.39999999999999994e221

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.39999999999999994e221 < a

    1. Initial program 94.2%

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

      \[\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. associate-*r*100.0%

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot t\right) \cdot y}} \]
      2. neg-mul-131.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.6 \cdot 10^{-6}:\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{elif}\;a \leq 4.4 \cdot 10^{-88}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.4 \cdot 10^{+221}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot t\right) \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 31.5% accurate, 18.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4000000000000001e109 < y < 6.2000000000000001e-9

    1. Initial program 96.3%

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

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

        \[\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 75.1%

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

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

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

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

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

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

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

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

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

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

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

    if 6.2000000000000001e-9 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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 y around 0 35.6%

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

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

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

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

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

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

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

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

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

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

      \[\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}\;y \leq -1.4 \cdot 10^{+109}:\\ \;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-9}:\\ \;\;\;\;x - x \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 30.1% accurate, 18.5× speedup?

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

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

\mathbf{elif}\;y \leq 5 \cdot 10^{-10}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\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 y < -1.25e109

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e109 < y < 5.00000000000000031e-10

    1. Initial program 96.3%

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

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

        \[\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 75.1%

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000031e-10 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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 y around 0 35.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 24.5% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{-12} \lor \neg \left(a \leq 7.5 \cdot 10^{-83}\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.19999999999999992e-12 or 7.4999999999999997e-83 < a

    1. Initial program 96.1%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-define96.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-neg96.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 63.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999992e-12 < a < 7.4999999999999997e-83

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.2 \cdot 10^{-12} \lor \neg \left(a \leq 7.5 \cdot 10^{-83}\right):\\ \;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 23.1% accurate, 19.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.46 \cdot 10^{+48} \lor \neg \left(a \leq 1.3 \cdot 10^{-71}\right):\\
\;\;\;\;\left(x \cdot t\right) \cdot \left(-y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.46e48 or 1.2999999999999999e-71 < a

    1. Initial program 95.9%

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

      \[\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. associate-*r*100.0%

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot t\right) \cdot y}} \]
      2. neg-mul-143.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.46e48 < a < 1.2999999999999999e-71

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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 y around 0 50.9%

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

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

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

Alternative 14: 28.1% accurate, 19.6× speedup?

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

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

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

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


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

    1. Initial program 100.0%

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

      \[\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. associate-*r*100.0%

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot t\right) \cdot y}} \]
      2. neg-mul-156.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999998e25 < y < 1.7e-4

    1. Initial program 95.7%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. Step-by-step derivation
      1. fma-define95.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-neg95.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 78.9%

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

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

    if 1.7e-4 < y

    1. Initial program 100.0%

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

      \[\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. associate-*r*100.0%

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

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

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

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

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

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

        \[\leadsto x \cdot e^{\color{blue}{\left(-1 \cdot t\right) \cdot y}} \]
      2. neg-mul-161.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 31.4% accurate, 22.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.6 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\

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


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

    1. Initial program 97.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-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 66.5%

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

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

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

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

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

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

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

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

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

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

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

    if 6.59999999999999954e-8 < y

    1. Initial program 100.0%

      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
    2. 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 y around 0 35.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 19.2% accurate, 315.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 97.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.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-neg97.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-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 58.6%

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

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

Reproduce

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