
(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 (- (* 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 98.8%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -870000.0)
(* x (exp (* y (- t))))
(if (<= t 1.35e+151)
(* x (exp (- (* y (log z)) (* a b))))
(* x (exp (* y (- (log z) t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -870000.0) {
tmp = x * exp((y * -t));
} else if (t <= 1.35e+151) {
tmp = x * exp(((y * log(z)) - (a * b)));
} else {
tmp = x * exp((y * (log(z) - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-870000.0d0)) then
tmp = x * exp((y * -t))
else if (t <= 1.35d+151) then
tmp = x * exp(((y * log(z)) - (a * b)))
else
tmp = x * exp((y * (log(z) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -870000.0) {
tmp = x * Math.exp((y * -t));
} else if (t <= 1.35e+151) {
tmp = x * Math.exp(((y * Math.log(z)) - (a * b)));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -870000.0: tmp = x * math.exp((y * -t)) elif t <= 1.35e+151: tmp = x * math.exp(((y * math.log(z)) - (a * b))) else: tmp = x * math.exp((y * (math.log(z) - t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -870000.0) tmp = Float64(x * exp(Float64(y * Float64(-t)))); elseif (t <= 1.35e+151) tmp = Float64(x * exp(Float64(Float64(y * log(z)) - Float64(a * b)))); else tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -870000.0) tmp = x * exp((y * -t)); elseif (t <= 1.35e+151) tmp = x * exp(((y * log(z)) - (a * b))); else tmp = x * exp((y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -870000.0], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+151], N[(x * N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -870000:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+151}:\\
\;\;\;\;x \cdot e^{y \cdot \log z - a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if t < -8.7e5Initial program 100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in t around inf 81.8%
associate-*r*81.8%
neg-mul-181.8%
Simplified81.8%
if -8.7e5 < t < 1.3500000000000001e151Initial program 98.7%
Taylor expanded in z around 0 98.1%
mul-1-neg98.1%
distribute-rgt-neg-out98.1%
Simplified98.1%
Taylor expanded in t around 0 96.8%
+-commutative96.8%
mul-1-neg96.8%
unsub-neg96.8%
Simplified96.8%
if 1.3500000000000001e151 < t Initial program 96.6%
fma-define96.6%
sub-neg96.6%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 93.4%
Final simplification92.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.42e-8) (not (<= y 9e-12))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (- b) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.42e-8) || !(y <= 9e-12)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (-b - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.42d-8)) .or. (.not. (y <= 9d-12))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * (-b - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.42e-8) || !(y <= 9e-12)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (-b - z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.42e-8) or not (y <= 9e-12): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (-b - z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.42e-8) || !(y <= 9e-12)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.42e-8) || ~((y <= 9e-12))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (-b - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.42e-8], N[Not[LessEqual[y, 9e-12]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.42 \cdot 10^{-8} \lor \neg \left(y \leq 9 \cdot 10^{-12}\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}
if y < -1.41999999999999998e-8 or 8.99999999999999962e-12 < y Initial program 99.9%
fma-define99.9%
sub-neg99.9%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 90.2%
if -1.41999999999999998e-8 < y < 8.99999999999999962e-12Initial program 97.7%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 87.0%
associate-*r*87.0%
mul-1-neg87.0%
+-commutative87.0%
Simplified87.0%
Final simplification88.6%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * 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 * 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 * b)));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * b)))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * 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 * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b}
\end{array}
Initial program 98.8%
Taylor expanded in z around 0 98.4%
mul-1-neg98.4%
distribute-rgt-neg-out98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- t))))))
(if (<= t -3.3)
t_1
(if (<= t -2.65e-107)
(* x (pow z y))
(if (<= t 3.8e-84) (* x (exp (* a (- (- b) z)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((y * -t));
double tmp;
if (t <= -3.3) {
tmp = t_1;
} else if (t <= -2.65e-107) {
tmp = x * pow(z, y);
} else if (t <= 3.8e-84) {
tmp = x * exp((a * (-b - z)));
} 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((y * -t))
if (t <= (-3.3d0)) then
tmp = t_1
else if (t <= (-2.65d-107)) then
tmp = x * (z ** y)
else if (t <= 3.8d-84) then
tmp = x * exp((a * (-b - z)))
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((y * -t));
double tmp;
if (t <= -3.3) {
tmp = t_1;
} else if (t <= -2.65e-107) {
tmp = x * Math.pow(z, y);
} else if (t <= 3.8e-84) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((y * -t)) tmp = 0 if t <= -3.3: tmp = t_1 elif t <= -2.65e-107: tmp = x * math.pow(z, y) elif t <= 3.8e-84: tmp = x * math.exp((a * (-b - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(y * Float64(-t)))) tmp = 0.0 if (t <= -3.3) tmp = t_1; elseif (t <= -2.65e-107) tmp = Float64(x * (z ^ y)); elseif (t <= 3.8e-84) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((y * -t)); tmp = 0.0; if (t <= -3.3) tmp = t_1; elseif (t <= -2.65e-107) tmp = x * (z ^ y); elseif (t <= 3.8e-84) tmp = x * exp((a * (-b - z))); 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[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.3], t$95$1, If[LessEqual[t, -2.65e-107], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e-84], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{if}\;t \leq -3.3:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.65 \cdot 10^{-107}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-84}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.2999999999999998 or 3.79999999999999986e-84 < t Initial program 99.3%
Taylor expanded in z around 0 99.3%
mul-1-neg99.3%
distribute-rgt-neg-out99.3%
Simplified99.3%
Taylor expanded in t around inf 81.4%
associate-*r*81.4%
neg-mul-181.4%
Simplified81.4%
if -3.2999999999999998 < t < -2.65e-107Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 72.3%
Taylor expanded in t around 0 72.3%
if -2.65e-107 < t < 3.79999999999999986e-84Initial program 97.8%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 77.8%
associate-*r*77.8%
mul-1-neg77.8%
+-commutative77.8%
Simplified77.8%
Final simplification79.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.15e-89) (not (<= b 420000.0))) (* x (exp (- (* a b)))) (* x (exp (* y (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.15e-89) || !(b <= 420000.0)) {
tmp = x * exp(-(a * b));
} else {
tmp = x * exp((y * -t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.15d-89)) .or. (.not. (b <= 420000.0d0))) then
tmp = x * exp(-(a * b))
else
tmp = x * exp((y * -t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.15e-89) || !(b <= 420000.0)) {
tmp = x * Math.exp(-(a * b));
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.15e-89) or not (b <= 420000.0): tmp = x * math.exp(-(a * b)) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.15e-89) || !(b <= 420000.0)) tmp = Float64(x * exp(Float64(-Float64(a * b)))); else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.15e-89) || ~((b <= 420000.0))) tmp = x * exp(-(a * b)); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.15e-89], N[Not[LessEqual[b, 420000.0]], $MachinePrecision]], N[(x * N[Exp[(-N[(a * b), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{-89} \lor \neg \left(b \leq 420000\right):\\
\;\;\;\;x \cdot e^{-a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if b < -1.15e-89 or 4.2e5 < b Initial program 99.3%
fma-define99.3%
sub-neg99.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 78.7%
Taylor expanded in z around 0 78.7%
associate-*r*78.7%
mul-1-neg78.7%
Simplified78.7%
if -1.15e-89 < b < 4.2e5Initial program 98.2%
Taylor expanded in z around 0 97.4%
mul-1-neg97.4%
distribute-rgt-neg-out97.4%
Simplified97.4%
Taylor expanded in t around inf 75.5%
associate-*r*75.5%
neg-mul-175.5%
Simplified75.5%
Final simplification77.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.00082) (not (<= y 0.0032))) (* 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.00082) || !(y <= 0.0032)) {
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.00082d0)) .or. (.not. (y <= 0.0032d0))) 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.00082) || !(y <= 0.0032)) {
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.00082) or not (y <= 0.0032): 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.00082) || !(y <= 0.0032)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(-Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -0.00082) || ~((y <= 0.0032))) 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.00082], N[Not[LessEqual[y, 0.0032]], $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.00082 \lor \neg \left(y \leq 0.0032\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{-a \cdot b}\\
\end{array}
\end{array}
if y < -8.1999999999999998e-4 or 0.00320000000000000015 < y Initial program 99.9%
fma-define99.9%
sub-neg99.9%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 90.0%
Taylor expanded in t around 0 67.2%
if -8.1999999999999998e-4 < y < 0.00320000000000000015Initial program 97.7%
fma-define97.7%
sub-neg97.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 82.6%
Taylor expanded in z around 0 81.8%
associate-*r*81.8%
mul-1-neg81.8%
Simplified81.8%
Final simplification74.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.2e+22) (not (<= a 4e+123))) (* x (pow (- z) a)) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.2e+22) || !(a <= 4e+123)) {
tmp = x * pow(-z, a);
} 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 ((a <= (-2.2d+22)) .or. (.not. (a <= 4d+123))) then
tmp = x * (-z ** a)
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 ((a <= -2.2e+22) || !(a <= 4e+123)) {
tmp = x * Math.pow(-z, a);
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.2e+22) or not (a <= 4e+123): tmp = x * math.pow(-z, a) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.2e+22) || !(a <= 4e+123)) tmp = Float64(x * (Float64(-z) ^ a)); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.2e+22) || ~((a <= 4e+123))) tmp = x * (-z ^ a); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.2e+22], N[Not[LessEqual[a, 4e+123]], $MachinePrecision]], N[(x * N[Power[(-z), a], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{+22} \lor \neg \left(a \leq 4 \cdot 10^{+123}\right):\\
\;\;\;\;x \cdot {\left(-z\right)}^{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if a < -2.2e22 or 3.99999999999999991e123 < a Initial program 96.8%
fma-define96.8%
sub-neg96.8%
log1p-define99.9%
Simplified99.9%
Taylor expanded in y around 0 76.0%
Taylor expanded in b around 0 8.0%
Taylor expanded in z around inf 54.5%
neg-mul-154.5%
Simplified54.5%
if -2.2e22 < a < 3.99999999999999991e123Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 85.7%
Taylor expanded in t around 0 62.9%
Final simplification59.8%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.8e+86) (* x (- 1.0 (* y t))) (if (<= t -2.3e-14) (* b (- (/ x b) (* x a))) (* x (pow z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.8e+86) {
tmp = x * (1.0 - (y * t));
} else if (t <= -2.3e-14) {
tmp = b * ((x / b) - (x * a));
} 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 <= (-4.8d+86)) then
tmp = x * (1.0d0 - (y * t))
else if (t <= (-2.3d-14)) then
tmp = b * ((x / b) - (x * a))
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 <= -4.8e+86) {
tmp = x * (1.0 - (y * t));
} else if (t <= -2.3e-14) {
tmp = b * ((x / b) - (x * a));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4.8e+86: tmp = x * (1.0 - (y * t)) elif t <= -2.3e-14: tmp = b * ((x / b) - (x * a)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.8e+86) tmp = Float64(x * Float64(1.0 - Float64(y * t))); elseif (t <= -2.3e-14) tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); 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 <= -4.8e+86) tmp = x * (1.0 - (y * t)); elseif (t <= -2.3e-14) tmp = b * ((x / b) - (x * a)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.8e+86], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.3e-14], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+86}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-14}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -4.8000000000000001e86Initial program 100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in t around inf 78.4%
associate-*r*78.4%
neg-mul-178.4%
Simplified78.4%
Taylor expanded in t around 0 24.8%
neg-mul-124.8%
unsub-neg24.8%
Simplified24.8%
if -4.8000000000000001e86 < t < -2.29999999999999998e-14Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 65.0%
Taylor expanded in z around 0 65.0%
associate-*r*65.0%
mul-1-neg65.0%
Simplified65.0%
Taylor expanded in a around 0 56.3%
associate-*r*56.3%
mul-1-neg56.3%
*-commutative56.3%
Simplified56.3%
Taylor expanded in b around inf 65.2%
+-commutative65.2%
mul-1-neg65.2%
unsub-neg65.2%
*-commutative65.2%
Simplified65.2%
if -2.29999999999999998e-14 < t Initial program 98.4%
fma-define98.4%
sub-neg98.4%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 71.3%
Taylor expanded in t around 0 63.1%
Final simplification56.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3e+208) (* x (- 1.0 (* y t))) (if (<= y 1.2e-92) (- x (* x (* a b))) (* x (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3e+208) {
tmp = x * (1.0 - (y * t));
} else if (y <= 1.2e-92) {
tmp = x - (x * (a * b));
} 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 <= (-3d+208)) then
tmp = x * (1.0d0 - (y * t))
else if (y <= 1.2d-92) then
tmp = x - (x * (a * b))
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 <= -3e+208) {
tmp = x * (1.0 - (y * t));
} else if (y <= 1.2e-92) {
tmp = x - (x * (a * b));
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3e+208: tmp = x * (1.0 - (y * t)) elif y <= 1.2e-92: tmp = x - (x * (a * b)) else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3e+208) tmp = Float64(x * Float64(1.0 - Float64(y * t))); elseif (y <= 1.2e-92) tmp = Float64(x - Float64(x * Float64(a * b))); 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 <= -3e+208) tmp = x * (1.0 - (y * t)); elseif (y <= 1.2e-92) tmp = x - (x * (a * b)); else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3e+208], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-92], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+208}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-92}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -2.99999999999999995e208Initial program 100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in t around inf 82.9%
associate-*r*82.9%
neg-mul-182.9%
Simplified82.9%
Taylor expanded in t around 0 40.6%
neg-mul-140.6%
unsub-neg40.6%
Simplified40.6%
if -2.99999999999999995e208 < y < 1.2000000000000001e-92Initial program 98.1%
fma-define98.1%
sub-neg98.1%
log1p-define99.9%
Simplified99.9%
Taylor expanded in y around 0 73.3%
Taylor expanded in z around 0 72.7%
associate-*r*72.7%
mul-1-neg72.7%
Simplified72.7%
Taylor expanded in a around 0 35.7%
mul-1-neg35.7%
unsub-neg35.7%
associate-*r*38.3%
Simplified38.3%
if 1.2000000000000001e-92 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 43.1%
Taylor expanded in b around 0 6.3%
Taylor expanded in z around 0 6.1%
mul-1-neg6.1%
unsub-neg6.1%
*-commutative6.1%
Simplified6.1%
Taylor expanded in z around inf 25.7%
mul-1-neg25.7%
*-commutative25.7%
associate-*r*28.0%
distribute-rgt-neg-in28.0%
distribute-rgt-neg-in28.0%
Simplified28.0%
Final simplification35.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.8e-118) (not (<= y 3e-94))) (* x (* z (- a))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.8e-118) || !(y <= 3e-94)) {
tmp = x * (z * -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 <= (-4.8d-118)) .or. (.not. (y <= 3d-94))) then
tmp = x * (z * -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 <= -4.8e-118) || !(y <= 3e-94)) {
tmp = x * (z * -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.8e-118) or not (y <= 3e-94): tmp = x * (z * -a) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.8e-118) || !(y <= 3e-94)) tmp = Float64(x * Float64(z * Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.8e-118) || ~((y <= 3e-94))) tmp = x * (z * -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.8e-118], N[Not[LessEqual[y, 3e-94]], $MachinePrecision]], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-118} \lor \neg \left(y \leq 3 \cdot 10^{-94}\right):\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.8000000000000003e-118 or 3.0000000000000001e-94 < y Initial program 99.3%
fma-define99.3%
sub-neg99.3%
log1p-define99.9%
Simplified99.9%
Taylor expanded in y around 0 46.1%
Taylor expanded in b around 0 6.8%
Taylor expanded in z around 0 6.0%
mul-1-neg6.0%
unsub-neg6.0%
*-commutative6.0%
Simplified6.0%
Taylor expanded in z around inf 19.5%
mul-1-neg19.5%
*-commutative19.5%
associate-*r*20.0%
distribute-rgt-neg-in20.0%
distribute-rgt-neg-in20.0%
Simplified20.0%
if -4.8000000000000003e-118 < y < 3.0000000000000001e-94Initial program 97.9%
fma-define97.9%
sub-neg97.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 59.2%
Taylor expanded in y around 0 43.7%
Final simplification28.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.8e-118) (* a (- (* x z))) (if (<= y 4.4e-93) x (* x (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.8e-118) {
tmp = a * -(x * z);
} else if (y <= 4.4e-93) {
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 <= (-4.8d-118)) then
tmp = a * -(x * z)
else if (y <= 4.4d-93) 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 <= -4.8e-118) {
tmp = a * -(x * z);
} else if (y <= 4.4e-93) {
tmp = x;
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.8e-118: tmp = a * -(x * z) elif y <= 4.4e-93: tmp = x else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.8e-118) tmp = Float64(a * Float64(-Float64(x * z))); elseif (y <= 4.4e-93) 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 <= -4.8e-118) tmp = a * -(x * z); elseif (y <= 4.4e-93) tmp = x; else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.8e-118], N[(a * (-N[(x * z), $MachinePrecision])), $MachinePrecision], If[LessEqual[y, 4.4e-93], x, N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-118}:\\
\;\;\;\;a \cdot \left(-x \cdot z\right)\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-93}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -4.8000000000000003e-118Initial program 98.8%
fma-define98.8%
sub-neg98.8%
log1p-define99.9%
Simplified99.9%
Taylor expanded in y around 0 48.9%
Taylor expanded in b around 0 7.2%
Taylor expanded in z around 0 5.9%
mul-1-neg5.9%
unsub-neg5.9%
*-commutative5.9%
Simplified5.9%
Taylor expanded in z around inf 13.8%
associate-*r*13.8%
mul-1-neg13.8%
Simplified13.8%
if -4.8000000000000003e-118 < y < 4.39999999999999991e-93Initial program 97.9%
fma-define97.9%
sub-neg97.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 59.2%
Taylor expanded in y around 0 43.7%
if 4.39999999999999991e-93 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 43.1%
Taylor expanded in b around 0 6.3%
Taylor expanded in z around 0 6.1%
mul-1-neg6.1%
unsub-neg6.1%
*-commutative6.1%
Simplified6.1%
Taylor expanded in z around inf 25.7%
mul-1-neg25.7%
*-commutative25.7%
associate-*r*28.0%
distribute-rgt-neg-in28.0%
distribute-rgt-neg-in28.0%
Simplified28.0%
Final simplification29.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x 1e-117) (* a (- (* x z))) (- x (* b (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 1e-117) {
tmp = a * -(x * z);
} 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 <= 1d-117) then
tmp = a * -(x * z)
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 <= 1e-117) {
tmp = a * -(x * z);
} else {
tmp = x - (b * (x * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 1e-117: tmp = a * -(x * z) else: tmp = x - (b * (x * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 1e-117) tmp = Float64(a * Float64(-Float64(x * z))); 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 <= 1e-117) tmp = a * -(x * z); else tmp = x - (b * (x * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 1e-117], N[(a * (-N[(x * z), $MachinePrecision])), $MachinePrecision], N[(x - N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{-117}:\\
\;\;\;\;a \cdot \left(-x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if x < 1.00000000000000003e-117Initial program 98.8%
fma-define98.8%
sub-neg98.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 63.2%
Taylor expanded in b around 0 20.0%
Taylor expanded in z around 0 19.2%
mul-1-neg19.2%
unsub-neg19.2%
*-commutative19.2%
Simplified19.2%
Taylor expanded in z around inf 21.7%
associate-*r*21.7%
mul-1-neg21.7%
Simplified21.7%
if 1.00000000000000003e-117 < x Initial program 98.9%
fma-define98.9%
sub-neg98.9%
log1p-define99.9%
Simplified99.9%
Taylor expanded in y around 0 55.7%
Taylor expanded in z around 0 54.6%
associate-*r*54.6%
mul-1-neg54.6%
Simplified54.6%
Taylor expanded in a around 0 31.8%
associate-*r*31.8%
mul-1-neg31.8%
*-commutative31.8%
Simplified31.8%
add-sqr-sqrt11.8%
sqrt-unprod24.7%
sqr-neg24.7%
sqrt-unprod12.1%
add-sqr-sqrt18.2%
cancel-sign-sub-inv18.2%
associate-*r*20.3%
*-commutative20.3%
*-commutative20.3%
add-sqr-sqrt13.2%
sqrt-unprod27.0%
sqr-neg27.0%
sqrt-unprod13.8%
add-sqr-sqrt32.8%
Applied egg-rr32.8%
Final simplification25.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x 2.9e-115) (* a (- (* x z))) (* x (- 1.0 (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.9e-115) {
tmp = a * -(x * z);
} 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 <= 2.9d-115) then
tmp = a * -(x * z)
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 <= 2.9e-115) {
tmp = a * -(x * z);
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 2.9e-115: tmp = a * -(x * z) else: tmp = x * (1.0 - (y * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 2.9e-115) tmp = Float64(a * Float64(-Float64(x * z))); 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 <= 2.9e-115) tmp = a * -(x * z); else tmp = x * (1.0 - (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.9e-115], N[(a * (-N[(x * z), $MachinePrecision])), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.9 \cdot 10^{-115}:\\
\;\;\;\;a \cdot \left(-x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\end{array}
if x < 2.8999999999999998e-115Initial program 98.8%
fma-define98.8%
sub-neg98.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 62.8%
Taylor expanded in b around 0 19.9%
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 21.6%
associate-*r*21.6%
mul-1-neg21.6%
Simplified21.6%
if 2.8999999999999998e-115 < x Initial program 98.8%
Taylor expanded in z around 0 97.8%
mul-1-neg97.8%
distribute-rgt-neg-out97.8%
Simplified97.8%
Taylor expanded in t around inf 60.3%
associate-*r*60.3%
neg-mul-160.3%
Simplified60.3%
Taylor expanded in t around 0 31.9%
neg-mul-131.9%
unsub-neg31.9%
Simplified31.9%
Final simplification25.3%
(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 98.8%
fma-define98.8%
sub-neg98.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 73.5%
Taylor expanded in y around 0 19.1%
herbie shell --seed 2024186
(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))))))