
(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:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 97.7%
fma-define97.7%
sub-neg97.7%
log1p-define99.2%
Simplified99.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6e-97) (not (<= y 600.0))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6e-97) || !(y <= 600.0)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (log((1.0 - z)) - b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6d-97)) .or. (.not. (y <= 600.0d0))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * (log((1.0d0 - z)) - b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6e-97) || !(y <= 600.0)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (Math.log((1.0 - z)) - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6e-97) or not (y <= 600.0): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (math.log((1.0 - z)) - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6e-97) || !(y <= 600.0)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(log(Float64(1.0 - z)) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6e-97) || ~((y <= 600.0))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (log((1.0 - z)) - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6e-97], N[Not[LessEqual[y, 600.0]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-97} \lor \neg \left(y \leq 600\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\end{array}
\end{array}
if y < -6.00000000000000048e-97 or 600 < y Initial program 96.8%
fma-define96.8%
sub-neg96.8%
log1p-define98.7%
Simplified98.7%
Taylor expanded in a around 0 86.6%
if -6.00000000000000048e-97 < y < 600Initial program 99.0%
fma-define99.0%
sub-neg99.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 89.8%
Final simplification87.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.9e-96) (not (<= y 600.0))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.9e-96) || !(y <= 600.0)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * -b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.9d-96)) .or. (.not. (y <= 600.0d0))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * -b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.9e-96) || !(y <= 600.0)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.9e-96) or not (y <= 600.0): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.9e-96) || !(y <= 600.0)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.9e-96) || ~((y <= 600.0))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.9e-96], N[Not[LessEqual[y, 600.0]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{-96} \lor \neg \left(y \leq 600\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -2.89999999999999994e-96 or 600 < y Initial program 96.8%
fma-define96.8%
sub-neg96.8%
log1p-define98.7%
Simplified98.7%
Taylor expanded in a around 0 86.6%
if -2.89999999999999994e-96 < y < 600Initial program 99.0%
fma-define99.0%
sub-neg99.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 89.8%
Taylor expanded in z around 0 88.9%
associate-*r*88.9%
mul-1-neg88.9%
Simplified88.9%
Final simplification87.5%
(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}
Initial program 97.7%
Taylor expanded in z around 0 99.2%
+-commutative99.2%
associate-*r*99.2%
associate-*r*99.2%
distribute-lft-out99.2%
mul-1-neg99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -160000000.0)
t_1
(if (<= y 4200000.0)
(* x (exp (* a (- b))))
(if (<= y 2.6e+33) t_1 (* x (exp (* t (- y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * pow(z, y);
double tmp;
if (y <= -160000000.0) {
tmp = t_1;
} else if (y <= 4200000.0) {
tmp = x * exp((a * -b));
} else if (y <= 2.6e+33) {
tmp = t_1;
} else {
tmp = x * exp((t * -y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-160000000.0d0)) then
tmp = t_1
else if (y <= 4200000.0d0) then
tmp = x * exp((a * -b))
else if (y <= 2.6d+33) then
tmp = t_1
else
tmp = x * exp((t * -y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.pow(z, y);
double tmp;
if (y <= -160000000.0) {
tmp = t_1;
} else if (y <= 4200000.0) {
tmp = x * Math.exp((a * -b));
} else if (y <= 2.6e+33) {
tmp = t_1;
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -160000000.0: tmp = t_1 elif y <= 4200000.0: tmp = x * math.exp((a * -b)) elif y <= 2.6e+33: tmp = t_1 else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -160000000.0) tmp = t_1; elseif (y <= 4200000.0) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif (y <= 2.6e+33) tmp = t_1; else tmp = Float64(x * exp(Float64(t * Float64(-y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -160000000.0) tmp = t_1; elseif (y <= 4200000.0) tmp = x * exp((a * -b)); elseif (y <= 2.6e+33) tmp = t_1; else tmp = x * exp((t * -y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -160000000.0], t$95$1, If[LessEqual[y, 4200000.0], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+33], t$95$1, N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -160000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4200000:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if y < -1.6e8 or 4.2e6 < y < 2.5999999999999997e33Initial program 97.4%
fma-define97.4%
sub-neg97.4%
log1p-define98.7%
Simplified98.7%
Taylor expanded in a around 0 89.5%
Taylor expanded in t around 0 75.1%
if -1.6e8 < y < 4.2e6Initial program 97.5%
fma-define97.5%
sub-neg97.5%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 83.8%
Taylor expanded in z around 0 82.2%
associate-*r*82.2%
mul-1-neg82.2%
Simplified82.2%
if 2.5999999999999997e33 < y Initial program 98.4%
Taylor expanded in z around 0 98.4%
+-commutative98.4%
associate-*r*98.4%
associate-*r*98.4%
distribute-lft-out98.4%
mul-1-neg98.4%
Simplified98.4%
Taylor expanded in t around inf 75.4%
associate-*r*75.4%
neg-mul-175.4%
Simplified75.4%
Final simplification78.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -106000000.0) (not (<= y 12000.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 <= -106000000.0) || !(y <= 12000.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 <= (-106000000.0d0)) .or. (.not. (y <= 12000.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 <= -106000000.0) || !(y <= 12000.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 <= -106000000.0) or not (y <= 12000.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 <= -106000000.0) || !(y <= 12000.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 <= -106000000.0) || ~((y <= 12000.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, -106000000.0], N[Not[LessEqual[y, 12000.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 -106000000 \lor \neg \left(y \leq 12000\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.06e8 or 12000 < y Initial program 97.8%
fma-define97.9%
sub-neg97.9%
log1p-define98.6%
Simplified98.6%
Taylor expanded in a around 0 90.0%
Taylor expanded in t around 0 68.6%
if -1.06e8 < y < 12000Initial program 97.5%
fma-define97.5%
sub-neg97.5%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 83.8%
Taylor expanded in z around 0 82.2%
associate-*r*82.2%
mul-1-neg82.2%
Simplified82.2%
Final simplification74.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1e+50) (* x (- 1.0 (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1e+50) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1d+50)) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1e+50) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1e+50: tmp = x * (1.0 - (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1e+50) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1e+50) tmp = x * (1.0 - (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1e+50], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+50}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1.0000000000000001e50Initial program 98.0%
Taylor expanded in z around 0 98.0%
+-commutative98.0%
associate-*r*98.0%
associate-*r*98.0%
distribute-lft-out98.0%
mul-1-neg98.0%
Simplified98.0%
Taylor expanded in t around inf 71.3%
associate-*r*71.3%
neg-mul-171.3%
Simplified71.3%
Taylor expanded in t around 0 40.8%
neg-mul-140.8%
unsub-neg40.8%
Simplified40.8%
if -1.0000000000000001e50 < t Initial program 97.6%
fma-define97.6%
sub-neg97.6%
log1p-define99.5%
Simplified99.5%
Taylor expanded in a around 0 71.7%
Taylor expanded in t around 0 62.0%
Final simplification57.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.9e-178)
(* b (- (/ x b) (* x a)))
(if (<= y 2.4e-33)
(* x (- 1.0 (* a b)))
(if (<= y 2.4e+164) (* a (* x (- b))) (* x (* t (- y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.9e-178) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 2.4e-33) {
tmp = x * (1.0 - (a * b));
} else if (y <= 2.4e+164) {
tmp = a * (x * -b);
} 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.9d-178)) then
tmp = b * ((x / b) - (x * a))
else if (y <= 2.4d-33) then
tmp = x * (1.0d0 - (a * b))
else if (y <= 2.4d+164) then
tmp = a * (x * -b)
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.9e-178) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 2.4e-33) {
tmp = x * (1.0 - (a * b));
} else if (y <= 2.4e+164) {
tmp = a * (x * -b);
} else {
tmp = x * (t * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.9e-178: tmp = b * ((x / b) - (x * a)) elif y <= 2.4e-33: tmp = x * (1.0 - (a * b)) elif y <= 2.4e+164: tmp = a * (x * -b) else: tmp = x * (t * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.9e-178) tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); elseif (y <= 2.4e-33) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (y <= 2.4e+164) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = Float64(x * Float64(t * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.9e-178) tmp = b * ((x / b) - (x * a)); elseif (y <= 2.4e-33) tmp = x * (1.0 - (a * b)); elseif (y <= 2.4e+164) tmp = a * (x * -b); else tmp = x * (t * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.9e-178], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e-33], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e+164], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-178}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-33}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+164}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if y < -1.90000000000000007e-178Initial program 96.3%
fma-define96.3%
sub-neg96.3%
log1p-define99.1%
Simplified99.1%
Taylor expanded in y around 0 46.4%
Taylor expanded in z around 0 44.6%
associate-*r*44.6%
mul-1-neg44.6%
Simplified44.6%
Taylor expanded in a around 0 22.0%
neg-mul-122.0%
distribute-rgt-neg-in22.0%
Simplified22.0%
Taylor expanded in b around inf 29.7%
+-commutative29.7%
mul-1-neg29.7%
unsub-neg29.7%
*-commutative29.7%
Simplified29.7%
if -1.90000000000000007e-178 < y < 2.4e-33Initial program 98.7%
fma-define98.7%
sub-neg98.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 91.7%
Taylor expanded in z around 0 91.7%
associate-*r*91.7%
mul-1-neg91.7%
Simplified91.7%
Taylor expanded in a around 0 52.5%
neg-mul-152.5%
distribute-rgt-neg-in52.5%
Simplified52.5%
if 2.4e-33 < y < 2.40000000000000011e164Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 37.4%
Taylor expanded in z around 0 37.4%
associate-*r*37.4%
mul-1-neg37.4%
Simplified37.4%
Taylor expanded in a around 0 18.9%
neg-mul-118.9%
distribute-rgt-neg-in18.9%
Simplified18.9%
Taylor expanded in a around inf 41.9%
associate-*r*41.9%
mul-1-neg41.9%
*-commutative41.9%
Simplified41.9%
if 2.40000000000000011e164 < y Initial program 97.3%
Taylor expanded in z around 0 97.3%
+-commutative97.3%
associate-*r*97.3%
associate-*r*97.3%
distribute-lft-out97.3%
mul-1-neg97.3%
Simplified97.3%
Taylor expanded in t around inf 81.7%
associate-*r*81.7%
neg-mul-181.7%
Simplified81.7%
Taylor expanded in t around 0 28.9%
neg-mul-128.9%
unsub-neg28.9%
Simplified28.9%
Taylor expanded in t around inf 23.7%
mul-1-neg23.7%
associate-*r*26.2%
distribute-rgt-neg-in26.2%
*-commutative26.2%
associate-*r*31.4%
distribute-rgt-neg-out31.4%
*-commutative31.4%
distribute-rgt-neg-in31.4%
Simplified31.4%
Final simplification38.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (* a (- b)))))
(if (<= a -3.3e+115)
t_1
(if (<= a -2.8e-108) (* t (* x (- y))) (if (<= a 2.6e-55) x t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (a * -b);
double tmp;
if (a <= -3.3e+115) {
tmp = t_1;
} else if (a <= -2.8e-108) {
tmp = t * (x * -y);
} else if (a <= 2.6e-55) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (a * -b)
if (a <= (-3.3d+115)) then
tmp = t_1
else if (a <= (-2.8d-108)) then
tmp = t * (x * -y)
else if (a <= 2.6d-55) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (a * -b);
double tmp;
if (a <= -3.3e+115) {
tmp = t_1;
} else if (a <= -2.8e-108) {
tmp = t * (x * -y);
} else if (a <= 2.6e-55) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (a * -b) tmp = 0 if a <= -3.3e+115: tmp = t_1 elif a <= -2.8e-108: tmp = t * (x * -y) elif a <= 2.6e-55: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(a * Float64(-b))) tmp = 0.0 if (a <= -3.3e+115) tmp = t_1; elseif (a <= -2.8e-108) tmp = Float64(t * Float64(x * Float64(-y))); elseif (a <= 2.6e-55) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (a * -b); tmp = 0.0; if (a <= -3.3e+115) tmp = t_1; elseif (a <= -2.8e-108) tmp = t * (x * -y); elseif (a <= 2.6e-55) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.3e+115], t$95$1, If[LessEqual[a, -2.8e-108], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.6e-55], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{if}\;a \leq -3.3 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{-108}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-55}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.30000000000000005e115 or 2.5999999999999999e-55 < a Initial program 94.7%
fma-define94.7%
sub-neg94.7%
log1p-define98.2%
Simplified98.2%
Taylor expanded in y around 0 70.5%
Taylor expanded in z around 0 68.8%
associate-*r*68.8%
mul-1-neg68.8%
Simplified68.8%
Taylor expanded in a around 0 29.1%
neg-mul-129.1%
distribute-rgt-neg-in29.1%
Simplified29.1%
Taylor expanded in a around inf 28.2%
mul-1-neg28.2%
associate-*r*30.1%
*-commutative30.1%
distribute-rgt-neg-in30.1%
distribute-rgt-neg-in30.1%
Simplified30.1%
if -3.30000000000000005e115 < a < -2.8e-108Initial program 100.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 60.9%
associate-*r*60.9%
neg-mul-160.9%
Simplified60.9%
Taylor expanded in t around 0 22.7%
neg-mul-122.7%
unsub-neg22.7%
Simplified22.7%
Taylor expanded in t around inf 25.9%
associate-*r*25.9%
neg-mul-125.9%
Simplified25.9%
if -2.8e-108 < a < 2.5999999999999999e-55Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 39.0%
Taylor expanded in a around 0 32.9%
Final simplification30.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (* t (- y)))))
(if (<= y -2e-81)
t_1
(if (<= y 4.7e-36) x (if (<= y 1.25e+163) (* a (* x (- b))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (t * -y);
double tmp;
if (y <= -2e-81) {
tmp = t_1;
} else if (y <= 4.7e-36) {
tmp = x;
} else if (y <= 1.25e+163) {
tmp = a * (x * -b);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t * -y)
if (y <= (-2d-81)) then
tmp = t_1
else if (y <= 4.7d-36) then
tmp = x
else if (y <= 1.25d+163) then
tmp = a * (x * -b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (t * -y);
double tmp;
if (y <= -2e-81) {
tmp = t_1;
} else if (y <= 4.7e-36) {
tmp = x;
} else if (y <= 1.25e+163) {
tmp = a * (x * -b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (t * -y) tmp = 0 if y <= -2e-81: tmp = t_1 elif y <= 4.7e-36: tmp = x elif y <= 1.25e+163: tmp = a * (x * -b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(t * Float64(-y))) tmp = 0.0 if (y <= -2e-81) tmp = t_1; elseif (y <= 4.7e-36) tmp = x; elseif (y <= 1.25e+163) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (t * -y); tmp = 0.0; if (y <= -2e-81) tmp = t_1; elseif (y <= 4.7e-36) tmp = x; elseif (y <= 1.25e+163) tmp = a * (x * -b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e-81], t$95$1, If[LessEqual[y, 4.7e-36], x, If[LessEqual[y, 1.25e+163], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{if}\;y \leq -2 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-36}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+163}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.9999999999999999e-81 or 1.25e163 < y Initial program 95.9%
Taylor expanded in z around 0 98.3%
+-commutative98.3%
associate-*r*98.3%
associate-*r*98.3%
distribute-lft-out98.3%
mul-1-neg98.3%
Simplified98.3%
Taylor expanded in t around inf 65.6%
associate-*r*65.6%
neg-mul-165.6%
Simplified65.6%
Taylor expanded in t around 0 20.4%
neg-mul-120.4%
unsub-neg20.4%
Simplified20.4%
Taylor expanded in t around inf 17.1%
mul-1-neg17.1%
associate-*r*17.0%
distribute-rgt-neg-in17.0%
*-commutative17.0%
associate-*r*21.0%
distribute-rgt-neg-out21.0%
*-commutative21.0%
distribute-rgt-neg-in21.0%
Simplified21.0%
if -1.9999999999999999e-81 < y < 4.7000000000000003e-36Initial program 99.0%
fma-define99.0%
sub-neg99.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 89.5%
Taylor expanded in a around 0 36.7%
if 4.7000000000000003e-36 < y < 1.25e163Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 37.4%
Taylor expanded in z around 0 37.4%
associate-*r*37.4%
mul-1-neg37.4%
Simplified37.4%
Taylor expanded in a around 0 18.9%
neg-mul-118.9%
distribute-rgt-neg-in18.9%
Simplified18.9%
Taylor expanded in a around inf 41.9%
associate-*r*41.9%
mul-1-neg41.9%
*-commutative41.9%
Simplified41.9%
Final simplification30.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (* t (- y)))))
(if (<= y -2.4e-79)
t_1
(if (<= y 5.2e-35) x (if (<= y 2.8e+163) (* x (* a (- b))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (t * -y);
double tmp;
if (y <= -2.4e-79) {
tmp = t_1;
} else if (y <= 5.2e-35) {
tmp = x;
} else if (y <= 2.8e+163) {
tmp = x * (a * -b);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (t * -y)
if (y <= (-2.4d-79)) then
tmp = t_1
else if (y <= 5.2d-35) then
tmp = x
else if (y <= 2.8d+163) then
tmp = x * (a * -b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (t * -y);
double tmp;
if (y <= -2.4e-79) {
tmp = t_1;
} else if (y <= 5.2e-35) {
tmp = x;
} else if (y <= 2.8e+163) {
tmp = x * (a * -b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (t * -y) tmp = 0 if y <= -2.4e-79: tmp = t_1 elif y <= 5.2e-35: tmp = x elif y <= 2.8e+163: tmp = x * (a * -b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(t * Float64(-y))) tmp = 0.0 if (y <= -2.4e-79) tmp = t_1; elseif (y <= 5.2e-35) tmp = x; elseif (y <= 2.8e+163) tmp = Float64(x * Float64(a * Float64(-b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (t * -y); tmp = 0.0; if (y <= -2.4e-79) tmp = t_1; elseif (y <= 5.2e-35) tmp = x; elseif (y <= 2.8e+163) tmp = x * (a * -b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e-79], t$95$1, If[LessEqual[y, 5.2e-35], x, If[LessEqual[y, 2.8e+163], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{-79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+163}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.40000000000000006e-79 or 2.80000000000000015e163 < y Initial program 95.9%
Taylor expanded in z around 0 98.3%
+-commutative98.3%
associate-*r*98.3%
associate-*r*98.3%
distribute-lft-out98.3%
mul-1-neg98.3%
Simplified98.3%
Taylor expanded in t around inf 65.6%
associate-*r*65.6%
neg-mul-165.6%
Simplified65.6%
Taylor expanded in t around 0 20.4%
neg-mul-120.4%
unsub-neg20.4%
Simplified20.4%
Taylor expanded in t around inf 17.1%
mul-1-neg17.1%
associate-*r*17.0%
distribute-rgt-neg-in17.0%
*-commutative17.0%
associate-*r*21.0%
distribute-rgt-neg-out21.0%
*-commutative21.0%
distribute-rgt-neg-in21.0%
Simplified21.0%
if -2.40000000000000006e-79 < y < 5.20000000000000009e-35Initial program 99.0%
fma-define99.0%
sub-neg99.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 89.5%
Taylor expanded in a around 0 36.7%
if 5.20000000000000009e-35 < y < 2.80000000000000015e163Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 37.4%
Taylor expanded in z around 0 37.4%
associate-*r*37.4%
mul-1-neg37.4%
Simplified37.4%
Taylor expanded in a around 0 18.9%
neg-mul-118.9%
distribute-rgt-neg-in18.9%
Simplified18.9%
Taylor expanded in a around inf 41.9%
mul-1-neg41.9%
associate-*r*41.9%
*-commutative41.9%
distribute-rgt-neg-in41.9%
distribute-rgt-neg-in41.9%
Simplified41.9%
Final simplification30.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -7.8e+124) (not (<= b 4.5e-15))) (* x (- 1.0 (* a b))) (* x (- 1.0 (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -7.8e+124) || !(b <= 4.5e-15)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-7.8d+124)) .or. (.not. (b <= 4.5d-15))) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x * (1.0d0 - (y * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -7.8e+124) || !(b <= 4.5e-15)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -7.8e+124) or not (b <= 4.5e-15): tmp = x * (1.0 - (a * b)) else: tmp = x * (1.0 - (y * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -7.8e+124) || !(b <= 4.5e-15)) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(1.0 - Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -7.8e+124) || ~((b <= 4.5e-15))) tmp = x * (1.0 - (a * b)); else tmp = x * (1.0 - (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -7.8e+124], N[Not[LessEqual[b, 4.5e-15]], $MachinePrecision]], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.8 \cdot 10^{+124} \lor \neg \left(b \leq 4.5 \cdot 10^{-15}\right):\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\end{array}
if b < -7.8000000000000001e124 or 4.4999999999999998e-15 < b Initial program 97.9%
fma-define98.0%
sub-neg98.0%
log1p-define98.0%
Simplified98.0%
Taylor expanded in y around 0 75.8%
Taylor expanded in z around 0 75.8%
associate-*r*75.8%
mul-1-neg75.8%
Simplified75.8%
Taylor expanded in a around 0 36.6%
neg-mul-136.6%
distribute-rgt-neg-in36.6%
Simplified36.6%
if -7.8000000000000001e124 < b < 4.4999999999999998e-15Initial program 97.5%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 67.4%
associate-*r*67.4%
neg-mul-167.4%
Simplified67.4%
Taylor expanded in t around 0 36.1%
neg-mul-136.1%
unsub-neg36.1%
Simplified36.1%
Final simplification36.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.8e+84) (not (<= a 2.1e-57))) (* x (* a (- b))) (* x (- 1.0 (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.8e+84) || !(a <= 2.1e-57)) {
tmp = x * (a * -b);
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.8d+84)) .or. (.not. (a <= 2.1d-57))) then
tmp = x * (a * -b)
else
tmp = x * (1.0d0 - (y * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.8e+84) || !(a <= 2.1e-57)) {
tmp = x * (a * -b);
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.8e+84) or not (a <= 2.1e-57): tmp = x * (a * -b) else: tmp = x * (1.0 - (y * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.8e+84) || !(a <= 2.1e-57)) tmp = Float64(x * Float64(a * Float64(-b))); else tmp = Float64(x * Float64(1.0 - Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.8e+84) || ~((a <= 2.1e-57))) tmp = x * (a * -b); else tmp = x * (1.0 - (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.8e+84], N[Not[LessEqual[a, 2.1e-57]], $MachinePrecision]], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+84} \lor \neg \left(a \leq 2.1 \cdot 10^{-57}\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\end{array}
if a < -1.8e84 or 2.0999999999999999e-57 < a Initial program 95.0%
fma-define95.0%
sub-neg95.0%
log1p-define98.3%
Simplified98.3%
Taylor expanded in y around 0 70.4%
Taylor expanded in z around 0 68.7%
associate-*r*68.7%
mul-1-neg68.7%
Simplified68.7%
Taylor expanded in a around 0 27.8%
neg-mul-127.8%
distribute-rgt-neg-in27.8%
Simplified27.8%
Taylor expanded in a around inf 27.0%
mul-1-neg27.0%
associate-*r*28.7%
*-commutative28.7%
distribute-rgt-neg-in28.7%
distribute-rgt-neg-in28.7%
Simplified28.7%
if -1.8e84 < a < 2.0999999999999999e-57Initial program 100.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 70.8%
associate-*r*70.8%
neg-mul-170.8%
Simplified70.8%
Taylor expanded in t around 0 39.8%
neg-mul-139.8%
unsub-neg39.8%
Simplified39.8%
Final simplification34.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.7e+75) (not (<= a 1.06e-54))) (* x (* a (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.7e+75) || !(a <= 1.06e-54)) {
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.7d+75)) .or. (.not. (a <= 1.06d-54))) 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.7e+75) || !(a <= 1.06e-54)) {
tmp = x * (a * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.7e+75) or not (a <= 1.06e-54): tmp = x * (a * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.7e+75) || !(a <= 1.06e-54)) 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.7e+75) || ~((a <= 1.06e-54))) tmp = x * (a * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.7e+75], N[Not[LessEqual[a, 1.06e-54]], $MachinePrecision]], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+75} \lor \neg \left(a \leq 1.06 \cdot 10^{-54}\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.69999999999999998e75 or 1.0600000000000001e-54 < a Initial program 95.0%
fma-define95.1%
sub-neg95.1%
log1p-define98.3%
Simplified98.3%
Taylor expanded in y around 0 71.4%
Taylor expanded in z around 0 69.8%
associate-*r*69.8%
mul-1-neg69.8%
Simplified69.8%
Taylor expanded in a around 0 28.4%
neg-mul-128.4%
distribute-rgt-neg-in28.4%
Simplified28.4%
Taylor expanded in a around inf 27.5%
mul-1-neg27.5%
associate-*r*29.3%
*-commutative29.3%
distribute-rgt-neg-in29.3%
distribute-rgt-neg-in29.3%
Simplified29.3%
if -2.69999999999999998e75 < a < 1.0600000000000001e-54Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 42.3%
Taylor expanded in a around 0 27.3%
Final simplification28.2%
(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}
Initial program 97.7%
fma-define97.7%
sub-neg97.7%
log1p-define99.2%
Simplified99.2%
Taylor expanded in y around 0 55.9%
Taylor expanded in a around 0 16.7%
herbie shell --seed 2024165
(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))))))