
(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 16 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 96.5%
fma-define96.5%
sub-neg96.5%
log1p-define100.0%
Simplified100.0%
Final simplification100.0%
(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}
Initial program 96.5%
Final simplification96.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.1e-14) (not (<= y 1.65e-26))) (* x (exp (* y (- (log z) t)))) (* x (exp (* (- a) (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.1e-14) || !(y <= 1.65e-26)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((-a * (z + b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.1d-14)) .or. (.not. (y <= 1.65d-26))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((-a * (z + b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.1e-14) || !(y <= 1.65e-26)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((-a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.1e-14) or not (y <= 1.65e-26): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((-a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.1e-14) || !(y <= 1.65e-26)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(Float64(-a) * Float64(z + b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.1e-14) || ~((y <= 1.65e-26))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((-a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.1e-14], N[Not[LessEqual[y, 1.65e-26]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-14} \lor \neg \left(y \leq 1.65 \cdot 10^{-26}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if y < -2.0999999999999999e-14 or 1.6499999999999999e-26 < y Initial program 97.2%
fma-define97.2%
sub-neg97.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 95.1%
if -2.0999999999999999e-14 < y < 1.6499999999999999e-26Initial program 95.8%
Taylor expanded in y around 0 84.9%
sub-neg84.9%
log1p-define89.1%
Simplified89.1%
Taylor expanded in z around 0 89.1%
associate-*r*89.1%
associate-*r*89.1%
distribute-lft-out89.1%
mul-1-neg89.1%
Simplified89.1%
Final simplification92.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -0.0076)
t_1
(if (<= y 6.2e-15)
(* x (exp (* (- a) (+ z b))))
(if (or (<= y 1.85e+155) (not (<= y 2e+262)))
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 <= -0.0076) {
tmp = t_1;
} else if (y <= 6.2e-15) {
tmp = x * exp((-a * (z + b)));
} else if ((y <= 1.85e+155) || !(y <= 2e+262)) {
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 <= (-0.0076d0)) then
tmp = t_1
else if (y <= 6.2d-15) then
tmp = x * exp((-a * (z + b)))
else if ((y <= 1.85d+155) .or. (.not. (y <= 2d+262))) 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 <= -0.0076) {
tmp = t_1;
} else if (y <= 6.2e-15) {
tmp = x * Math.exp((-a * (z + b)));
} else if ((y <= 1.85e+155) || !(y <= 2e+262)) {
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 <= -0.0076: tmp = t_1 elif y <= 6.2e-15: tmp = x * math.exp((-a * (z + b))) elif (y <= 1.85e+155) or not (y <= 2e+262): 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 <= -0.0076) tmp = t_1; elseif (y <= 6.2e-15) tmp = Float64(x * exp(Float64(Float64(-a) * Float64(z + b)))); elseif ((y <= 1.85e+155) || !(y <= 2e+262)) 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 <= -0.0076) tmp = t_1; elseif (y <= 6.2e-15) tmp = x * exp((-a * (z + b))); elseif ((y <= 1.85e+155) || ~((y <= 2e+262))) 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, -0.0076], t$95$1, If[LessEqual[y, 6.2e-15], N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.85e+155], N[Not[LessEqual[y, 2e+262]], $MachinePrecision]], 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 -0.0076:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-15}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+155} \lor \neg \left(y \leq 2 \cdot 10^{+262}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if y < -0.00759999999999999998 or 6.1999999999999998e-15 < y < 1.8499999999999999e155 or 2e262 < y Initial program 97.4%
fma-define97.4%
sub-neg97.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 94.9%
Taylor expanded in t around 0 76.3%
if -0.00759999999999999998 < y < 6.1999999999999998e-15Initial program 95.9%
Taylor expanded in y around 0 84.5%
sub-neg84.5%
log1p-define88.6%
Simplified88.6%
Taylor expanded in z around 0 88.6%
associate-*r*88.6%
associate-*r*88.6%
distribute-lft-out88.6%
mul-1-neg88.6%
Simplified88.6%
if 1.8499999999999999e155 < y < 2e262Initial program 95.5%
fma-define95.5%
sub-neg95.5%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 95.5%
Taylor expanded in t around inf 73.5%
neg-mul-173.5%
Simplified73.5%
Final simplification81.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* t (- y))))))
(if (<= t -3.1e+22)
t_1
(if (<= t -4.8e-69)
(* x (exp (* a (- b))))
(if (<= t 3e-28) (* x (pow z y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((t * -y));
double tmp;
if (t <= -3.1e+22) {
tmp = t_1;
} else if (t <= -4.8e-69) {
tmp = x * exp((a * -b));
} else if (t <= 3e-28) {
tmp = x * pow(z, y);
} 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 * exp((t * -y))
if (t <= (-3.1d+22)) then
tmp = t_1
else if (t <= (-4.8d-69)) then
tmp = x * exp((a * -b))
else if (t <= 3d-28) then
tmp = x * (z ** y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((t * -y));
double tmp;
if (t <= -3.1e+22) {
tmp = t_1;
} else if (t <= -4.8e-69) {
tmp = x * Math.exp((a * -b));
} else if (t <= 3e-28) {
tmp = x * Math.pow(z, y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((t * -y)) tmp = 0 if t <= -3.1e+22: tmp = t_1 elif t <= -4.8e-69: tmp = x * math.exp((a * -b)) elif t <= 3e-28: tmp = x * math.pow(z, y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(t * Float64(-y)))) tmp = 0.0 if (t <= -3.1e+22) tmp = t_1; elseif (t <= -4.8e-69) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif (t <= 3e-28) tmp = Float64(x * (z ^ y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((t * -y)); tmp = 0.0; if (t <= -3.1e+22) tmp = t_1; elseif (t <= -4.8e-69) tmp = x * exp((a * -b)); elseif (t <= 3e-28) tmp = x * (z ^ y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.1e+22], t$95$1, If[LessEqual[t, -4.8e-69], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-28], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{-69}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-28}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.1000000000000002e22 or 3.00000000000000003e-28 < t Initial program 99.2%
fma-define99.2%
sub-neg99.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 79.9%
Taylor expanded in t around inf 79.9%
neg-mul-179.9%
Simplified79.9%
if -3.1000000000000002e22 < t < -4.8000000000000002e-69Initial program 89.0%
Taylor expanded in b around inf 78.2%
mul-1-neg78.2%
distribute-rgt-neg-out78.2%
Simplified78.2%
if -4.8000000000000002e-69 < t < 3.00000000000000003e-28Initial program 94.8%
fma-define94.8%
sub-neg94.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 77.0%
Taylor expanded in t around 0 77.0%
Final simplification78.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.02) (not (<= y 6.2e-15))) (* 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 <= -1.02) || !(y <= 6.2e-15)) {
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 <= (-1.02d0)) .or. (.not. (y <= 6.2d-15))) 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 <= -1.02) || !(y <= 6.2e-15)) {
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 <= -1.02) or not (y <= 6.2e-15): 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 <= -1.02) || !(y <= 6.2e-15)) 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 <= -1.02) || ~((y <= 6.2e-15))) 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, -1.02], N[Not[LessEqual[y, 6.2e-15]], $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 -1.02 \lor \neg \left(y \leq 6.2 \cdot 10^{-15}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.02 or 6.1999999999999998e-15 < y Initial program 97.1%
fma-define97.1%
sub-neg97.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 95.0%
Taylor expanded in t around 0 72.9%
if -1.02 < y < 6.1999999999999998e-15Initial program 95.9%
Taylor expanded in b around inf 82.8%
mul-1-neg82.8%
distribute-rgt-neg-out82.8%
Simplified82.8%
Final simplification77.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.3e-6) (* 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 <= -1.3e-6) {
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 <= (-1.3d-6)) 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 <= -1.3e-6) {
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 <= -1.3e-6: 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 <= -1.3e-6) 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 <= -1.3e-6) 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, -1.3e-6], 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.3 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1.30000000000000005e-6Initial program 98.5%
fma-define98.5%
sub-neg98.5%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 81.0%
Taylor expanded in t around inf 82.5%
neg-mul-182.5%
Simplified82.5%
Taylor expanded in y around 0 35.9%
associate-*r*35.9%
mul-1-neg35.9%
cancel-sign-sub-inv35.9%
Simplified35.9%
if -1.30000000000000005e-6 < t Initial program 95.9%
fma-define95.9%
sub-neg95.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 74.8%
Taylor expanded in t around 0 69.7%
Final simplification61.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -6.8e+14)
(* z (- (/ x z) (* x a)))
(if (<= a 98000000.0)
(* x (- 1.0 (* y t)))
(if (<= a 4.9e+89) (* a (* z (- x))) (- x (* x (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.8e+14) {
tmp = z * ((x / z) - (x * a));
} else if (a <= 98000000.0) {
tmp = x * (1.0 - (y * t));
} else if (a <= 4.9e+89) {
tmp = a * (z * -x);
} else {
tmp = x - (x * (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 (a <= (-6.8d+14)) then
tmp = z * ((x / z) - (x * a))
else if (a <= 98000000.0d0) then
tmp = x * (1.0d0 - (y * t))
else if (a <= 4.9d+89) then
tmp = a * (z * -x)
else
tmp = x - (x * (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 (a <= -6.8e+14) {
tmp = z * ((x / z) - (x * a));
} else if (a <= 98000000.0) {
tmp = x * (1.0 - (y * t));
} else if (a <= 4.9e+89) {
tmp = a * (z * -x);
} else {
tmp = x - (x * (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -6.8e+14: tmp = z * ((x / z) - (x * a)) elif a <= 98000000.0: tmp = x * (1.0 - (y * t)) elif a <= 4.9e+89: tmp = a * (z * -x) else: tmp = x - (x * (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.8e+14) tmp = Float64(z * Float64(Float64(x / z) - Float64(x * a))); elseif (a <= 98000000.0) tmp = Float64(x * Float64(1.0 - Float64(y * t))); elseif (a <= 4.9e+89) tmp = Float64(a * Float64(z * Float64(-x))); else tmp = Float64(x - Float64(x * Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -6.8e+14) tmp = z * ((x / z) - (x * a)); elseif (a <= 98000000.0) tmp = x * (1.0 - (y * t)); elseif (a <= 4.9e+89) tmp = a * (z * -x); else tmp = x - (x * (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.8e+14], N[(z * N[(N[(x / z), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 98000000.0], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.9e+89], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+14}:\\
\;\;\;\;z \cdot \left(\frac{x}{z} - x \cdot a\right)\\
\mathbf{elif}\;a \leq 98000000:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{elif}\;a \leq 4.9 \cdot 10^{+89}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -6.8e14Initial program 93.8%
Taylor expanded in y around 0 75.2%
sub-neg75.2%
log1p-define84.5%
Simplified84.5%
Taylor expanded in b around 0 9.9%
Taylor expanded in z around 0 14.5%
mul-1-neg14.5%
unsub-neg14.5%
*-commutative14.5%
Simplified14.5%
Taylor expanded in z around inf 27.9%
if -6.8e14 < a < 9.8e7Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 90.4%
Taylor expanded in t around inf 72.8%
neg-mul-172.8%
Simplified72.8%
Taylor expanded in y around 0 44.6%
associate-*r*44.6%
mul-1-neg44.6%
cancel-sign-sub-inv44.6%
Simplified44.6%
if 9.8e7 < a < 4.89999999999999996e89Initial program 100.0%
Taylor expanded in y around 0 72.2%
sub-neg72.2%
log1p-define72.2%
Simplified72.2%
Taylor expanded in b around 0 13.2%
Taylor expanded in z around 0 7.1%
mul-1-neg7.1%
unsub-neg7.1%
*-commutative7.1%
Simplified7.1%
Taylor expanded in z around inf 33.2%
associate-*r*33.2%
neg-mul-133.2%
Simplified33.2%
if 4.89999999999999996e89 < a Initial program 87.8%
Taylor expanded in b around inf 61.0%
mul-1-neg61.0%
distribute-rgt-neg-out61.0%
Simplified61.0%
Taylor expanded in a around 0 27.4%
mul-1-neg27.4%
unsub-neg27.4%
*-commutative27.4%
Simplified27.4%
Taylor expanded in a around 0 27.4%
associate-*r*36.6%
*-commutative36.6%
Simplified36.6%
Final simplification38.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.7e-41) (not (<= y 7e-137))) (* z (* x (- a))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.7e-41) || !(y <= 7e-137)) {
tmp = z * (x * -a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.7d-41)) .or. (.not. (y <= 7d-137))) then
tmp = z * (x * -a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.7e-41) || !(y <= 7e-137)) {
tmp = z * (x * -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.7e-41) or not (y <= 7e-137): tmp = z * (x * -a) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.7e-41) || !(y <= 7e-137)) tmp = Float64(z * Float64(x * Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.7e-41) || ~((y <= 7e-137))) tmp = z * (x * -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.7e-41], N[Not[LessEqual[y, 7e-137]], $MachinePrecision]], N[(z * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-41} \lor \neg \left(y \leq 7 \cdot 10^{-137}\right):\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.7e-41 or 7.0000000000000002e-137 < y Initial program 96.5%
Taylor expanded in y around 0 43.3%
sub-neg43.3%
log1p-define48.4%
Simplified48.4%
Taylor expanded in b around 0 6.5%
Taylor expanded in z around 0 7.3%
mul-1-neg7.3%
unsub-neg7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in z around inf 21.7%
mul-1-neg21.7%
*-commutative21.7%
*-commutative21.7%
associate-*r*19.6%
Simplified19.6%
if -2.7e-41 < y < 7.0000000000000002e-137Initial program 96.6%
Taylor expanded in b around inf 83.9%
mul-1-neg83.9%
distribute-rgt-neg-out83.9%
Simplified83.9%
Taylor expanded in a around 0 43.0%
Final simplification27.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.4e-41) (* z (* x (- a))) (if (<= y 7.2e-58) x (* x (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.4e-41) {
tmp = z * (x * -a);
} else if (y <= 7.2e-58) {
tmp = x;
} else {
tmp = x * (z * -a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-3.4d-41)) then
tmp = z * (x * -a)
else if (y <= 7.2d-58) then
tmp = x
else
tmp = x * (z * -a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.4e-41) {
tmp = z * (x * -a);
} else if (y <= 7.2e-58) {
tmp = x;
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.4e-41: tmp = z * (x * -a) elif y <= 7.2e-58: tmp = x else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.4e-41) tmp = Float64(z * Float64(x * Float64(-a))); elseif (y <= 7.2e-58) tmp = x; else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.4e-41) tmp = z * (x * -a); elseif (y <= 7.2e-58) tmp = x; else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.4e-41], N[(z * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e-58], x, N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-41}:\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-58}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -3.3999999999999998e-41Initial program 95.4%
Taylor expanded in y around 0 38.9%
sub-neg38.9%
log1p-define47.9%
Simplified47.9%
Taylor expanded in b around 0 4.6%
Taylor expanded in z around 0 5.1%
mul-1-neg5.1%
unsub-neg5.1%
*-commutative5.1%
Simplified5.1%
Taylor expanded in z around inf 12.8%
mul-1-neg12.8%
*-commutative12.8%
*-commutative12.8%
associate-*r*14.0%
Simplified14.0%
if -3.3999999999999998e-41 < y < 7.20000000000000019e-58Initial program 97.1%
Taylor expanded in b around inf 83.5%
mul-1-neg83.5%
distribute-rgt-neg-out83.5%
Simplified83.5%
Taylor expanded in a around 0 40.2%
if 7.20000000000000019e-58 < y Initial program 97.2%
Taylor expanded in y around 0 41.6%
sub-neg41.6%
log1p-define43.0%
Simplified43.0%
Taylor expanded in b around 0 6.1%
Taylor expanded in z around 0 7.3%
mul-1-neg7.3%
unsub-neg7.3%
*-commutative7.3%
Simplified7.3%
Taylor expanded in z around inf 28.1%
associate-*r*28.1%
neg-mul-128.1%
*-commutative28.1%
Simplified28.1%
Final simplification28.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.02e-39) (* z (* x (- a))) (if (<= y 1.05e-137) x (* a (* z (- x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.02e-39) {
tmp = z * (x * -a);
} else if (y <= 1.05e-137) {
tmp = x;
} else {
tmp = a * (z * -x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.02d-39)) then
tmp = z * (x * -a)
else if (y <= 1.05d-137) then
tmp = x
else
tmp = a * (z * -x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.02e-39) {
tmp = z * (x * -a);
} else if (y <= 1.05e-137) {
tmp = x;
} else {
tmp = a * (z * -x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.02e-39: tmp = z * (x * -a) elif y <= 1.05e-137: tmp = x else: tmp = a * (z * -x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.02e-39) tmp = Float64(z * Float64(x * Float64(-a))); elseif (y <= 1.05e-137) tmp = x; else tmp = Float64(a * Float64(z * Float64(-x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.02e-39) tmp = z * (x * -a); elseif (y <= 1.05e-137) tmp = x; else tmp = a * (z * -x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.02e-39], N[(z * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e-137], x, N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-39}:\\
\;\;\;\;z \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-137}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\end{array}
\end{array}
if y < -1.02000000000000007e-39Initial program 95.4%
Taylor expanded in y around 0 38.9%
sub-neg38.9%
log1p-define47.9%
Simplified47.9%
Taylor expanded in b around 0 4.6%
Taylor expanded in z around 0 5.1%
mul-1-neg5.1%
unsub-neg5.1%
*-commutative5.1%
Simplified5.1%
Taylor expanded in z around inf 12.8%
mul-1-neg12.8%
*-commutative12.8%
*-commutative12.8%
associate-*r*14.0%
Simplified14.0%
if -1.02000000000000007e-39 < y < 1.04999999999999996e-137Initial program 97.7%
Taylor expanded in b around inf 84.8%
mul-1-neg84.8%
distribute-rgt-neg-out84.8%
Simplified84.8%
Taylor expanded in a around 0 43.4%
if 1.04999999999999996e-137 < y Initial program 96.6%
Taylor expanded in y around 0 47.2%
sub-neg47.2%
log1p-define49.4%
Simplified49.4%
Taylor expanded in b around 0 8.5%
Taylor expanded in z around 0 9.4%
mul-1-neg9.4%
unsub-neg9.4%
*-commutative9.4%
Simplified9.4%
Taylor expanded in z around inf 31.5%
associate-*r*31.5%
neg-mul-131.5%
Simplified31.5%
Final simplification29.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x 7e-159) (* a (* z (- x))) (* x (- 1.0 (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 7e-159) {
tmp = a * (z * -x);
} 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 (x <= 7d-159) then
tmp = a * (z * -x)
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 (x <= 7e-159) {
tmp = a * (z * -x);
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 7e-159: tmp = a * (z * -x) else: tmp = x * (1.0 - (y * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 7e-159) tmp = Float64(a * Float64(z * Float64(-x))); 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 (x <= 7e-159) tmp = a * (z * -x); else tmp = x * (1.0 - (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 7e-159], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7 \cdot 10^{-159}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\end{array}
if x < 7.00000000000000005e-159Initial program 96.5%
Taylor expanded in y around 0 55.8%
sub-neg55.8%
log1p-define60.4%
Simplified60.4%
Taylor expanded in b around 0 18.2%
Taylor expanded in z around 0 19.1%
mul-1-neg19.1%
unsub-neg19.1%
*-commutative19.1%
Simplified19.1%
Taylor expanded in z around inf 22.7%
associate-*r*22.7%
neg-mul-122.7%
Simplified22.7%
if 7.00000000000000005e-159 < x Initial program 96.7%
fma-define96.7%
sub-neg96.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 72.2%
Taylor expanded in t around inf 54.9%
neg-mul-154.9%
Simplified54.9%
Taylor expanded in y around 0 30.2%
associate-*r*30.2%
mul-1-neg30.2%
cancel-sign-sub-inv30.2%
Simplified30.2%
Final simplification25.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x 5.5e-158) (* a (* z (- x))) (- x (* a (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 5.5e-158) {
tmp = a * (z * -x);
} else {
tmp = x - (a * (x * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 5.5d-158) then
tmp = a * (z * -x)
else
tmp = x - (a * (x * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 5.5e-158) {
tmp = a * (z * -x);
} else {
tmp = x - (a * (x * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 5.5e-158: tmp = a * (z * -x) else: tmp = x - (a * (x * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 5.5e-158) tmp = Float64(a * Float64(z * Float64(-x))); else tmp = Float64(x - Float64(a * Float64(x * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 5.5e-158) tmp = a * (z * -x); else tmp = x - (a * (x * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 5.5e-158], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.5 \cdot 10^{-158}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if x < 5.50000000000000025e-158Initial program 96.5%
Taylor expanded in y around 0 55.8%
sub-neg55.8%
log1p-define60.4%
Simplified60.4%
Taylor expanded in b around 0 18.2%
Taylor expanded in z around 0 19.1%
mul-1-neg19.1%
unsub-neg19.1%
*-commutative19.1%
Simplified19.1%
Taylor expanded in z around inf 22.7%
associate-*r*22.7%
neg-mul-122.7%
Simplified22.7%
if 5.50000000000000025e-158 < x Initial program 96.7%
Taylor expanded in b around inf 59.0%
mul-1-neg59.0%
distribute-rgt-neg-out59.0%
Simplified59.0%
Taylor expanded in a around 0 27.2%
mul-1-neg27.2%
unsub-neg27.2%
*-commutative27.2%
Simplified27.2%
Final simplification24.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x 2.5e-155) (* a (* z (- x))) (- x (* b (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.5e-155) {
tmp = a * (z * -x);
} else {
tmp = x - (b * (x * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 2.5d-155) then
tmp = a * (z * -x)
else
tmp = x - (b * (x * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.5e-155) {
tmp = a * (z * -x);
} else {
tmp = x - (b * (x * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 2.5e-155: tmp = a * (z * -x) else: tmp = x - (b * (x * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 2.5e-155) tmp = Float64(a * Float64(z * Float64(-x))); else tmp = Float64(x - Float64(b * Float64(x * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 2.5e-155) tmp = a * (z * -x); else tmp = x - (b * (x * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.5e-155], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], N[(x - N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5 \cdot 10^{-155}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if x < 2.4999999999999999e-155Initial program 96.5%
Taylor expanded in y around 0 55.8%
sub-neg55.8%
log1p-define60.4%
Simplified60.4%
Taylor expanded in b around 0 18.2%
Taylor expanded in z around 0 19.1%
mul-1-neg19.1%
unsub-neg19.1%
*-commutative19.1%
Simplified19.1%
Taylor expanded in z around inf 22.7%
associate-*r*22.7%
neg-mul-122.7%
Simplified22.7%
if 2.4999999999999999e-155 < x Initial program 96.7%
fma-define96.7%
sub-neg96.7%
log1p-define100.0%
Simplified100.0%
add-sqr-sqrt99.9%
pow299.9%
Applied egg-rr93.3%
Taylor expanded in b around inf 59.0%
mul-1-neg59.0%
distribute-rgt-neg-in59.0%
Simplified59.0%
Taylor expanded in a around 0 27.2%
mul-1-neg27.2%
unsub-neg27.2%
*-commutative27.2%
associate-*l*30.5%
Simplified30.5%
Final simplification25.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x 5.5e-160) (* a (* z (- x))) (- x (* x (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 5.5e-160) {
tmp = a * (z * -x);
} else {
tmp = x - (x * (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 (x <= 5.5d-160) then
tmp = a * (z * -x)
else
tmp = x - (x * (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 (x <= 5.5e-160) {
tmp = a * (z * -x);
} else {
tmp = x - (x * (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 5.5e-160: tmp = a * (z * -x) else: tmp = x - (x * (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 5.5e-160) tmp = Float64(a * Float64(z * Float64(-x))); else tmp = Float64(x - Float64(x * Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 5.5e-160) tmp = a * (z * -x); else tmp = x - (x * (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 5.5e-160], N[(a * N[(z * (-x)), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.5 \cdot 10^{-160}:\\
\;\;\;\;a \cdot \left(z \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < 5.5e-160Initial program 96.5%
Taylor expanded in y around 0 55.8%
sub-neg55.8%
log1p-define60.4%
Simplified60.4%
Taylor expanded in b around 0 18.2%
Taylor expanded in z around 0 19.1%
mul-1-neg19.1%
unsub-neg19.1%
*-commutative19.1%
Simplified19.1%
Taylor expanded in z around inf 22.7%
associate-*r*22.7%
neg-mul-122.7%
Simplified22.7%
if 5.5e-160 < x Initial program 96.7%
Taylor expanded in b around inf 59.0%
mul-1-neg59.0%
distribute-rgt-neg-out59.0%
Simplified59.0%
Taylor expanded in a around 0 27.2%
mul-1-neg27.2%
unsub-neg27.2%
*-commutative27.2%
Simplified27.2%
Taylor expanded in a around 0 27.2%
associate-*r*29.4%
*-commutative29.4%
Simplified29.4%
Final simplification25.1%
(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 96.5%
Taylor expanded in b around inf 56.9%
mul-1-neg56.9%
distribute-rgt-neg-out56.9%
Simplified56.9%
Taylor expanded in a around 0 18.4%
Final simplification18.4%
herbie shell --seed 2024096
(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))))))