
(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}
(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}
(FPCore (x y z t a b) :precision binary64 (if (<= y 3.4e+106) (* x (exp (- (* t (- y)) (* a b)))) (* x (pow (/ z (exp t)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 3.4e+106) {
tmp = x * exp(((t * -y) - (a * b)));
} else {
tmp = x * pow((z / exp(t)), y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 3.4d+106) then
tmp = x * exp(((t * -y) - (a * b)))
else
tmp = x * ((z / exp(t)) ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 3.4e+106) {
tmp = x * Math.exp(((t * -y) - (a * b)));
} else {
tmp = x * Math.pow((z / Math.exp(t)), y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 3.4e+106: tmp = x * math.exp(((t * -y) - (a * b))) else: tmp = x * math.pow((z / math.exp(t)), y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 3.4e+106) tmp = Float64(x * exp(Float64(Float64(t * Float64(-y)) - Float64(a * b)))); else tmp = Float64(x * (Float64(z / exp(t)) ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 3.4e+106) tmp = x * exp(((t * -y) - (a * b))); else tmp = x * ((z / exp(t)) ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 3.4e+106], N[(x * N[Exp[N[(N[(t * (-y)), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{+106}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right) - a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\end{array}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* t (- y))))))
(if (<= t -2.65e+44)
t_1
(if (<= t 5.2e-272)
(* x (exp (* a (- (+ z b)))))
(if (<= t 4.6e-182)
(* x (pow z y))
(if (<= t 6.2e+35) (* x (exp (* a (- b)))) 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 <= -2.65e+44) {
tmp = t_1;
} else if (t <= 5.2e-272) {
tmp = x * exp((a * -(z + b)));
} else if (t <= 4.6e-182) {
tmp = x * pow(z, y);
} else if (t <= 6.2e+35) {
tmp = x * exp((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 * exp((t * -y))
if (t <= (-2.65d+44)) then
tmp = t_1
else if (t <= 5.2d-272) then
tmp = x * exp((a * -(z + b)))
else if (t <= 4.6d-182) then
tmp = x * (z ** y)
else if (t <= 6.2d+35) then
tmp = x * exp((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 * Math.exp((t * -y));
double tmp;
if (t <= -2.65e+44) {
tmp = t_1;
} else if (t <= 5.2e-272) {
tmp = x * Math.exp((a * -(z + b)));
} else if (t <= 4.6e-182) {
tmp = x * Math.pow(z, y);
} else if (t <= 6.2e+35) {
tmp = x * Math.exp((a * -b));
} 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 <= -2.65e+44: tmp = t_1 elif t <= 5.2e-272: tmp = x * math.exp((a * -(z + b))) elif t <= 4.6e-182: tmp = x * math.pow(z, y) elif t <= 6.2e+35: tmp = x * math.exp((a * -b)) 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 <= -2.65e+44) tmp = t_1; elseif (t <= 5.2e-272) tmp = Float64(x * exp(Float64(a * Float64(-Float64(z + b))))); elseif (t <= 4.6e-182) tmp = Float64(x * (z ^ y)); elseif (t <= 6.2e+35) tmp = Float64(x * exp(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 * exp((t * -y)); tmp = 0.0; if (t <= -2.65e+44) tmp = t_1; elseif (t <= 5.2e-272) tmp = x * exp((a * -(z + b))); elseif (t <= 4.6e-182) tmp = x * (z ^ y); elseif (t <= 6.2e+35) tmp = x * exp((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[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.65e+44], t$95$1, If[LessEqual[t, 5.2e-272], N[(x * N[Exp[N[(a * (-N[(z + b), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.6e-182], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+35], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $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 -2.65 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-272}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-\left(z + b\right)\right)}\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-182}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+35}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.5e+163) (not (<= y 4.3e+110))) (* 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 <= -2.5e+163) || !(y <= 4.3e+110)) {
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 <= (-2.5d+163)) .or. (.not. (y <= 4.3d+110))) 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 <= -2.5e+163) || !(y <= 4.3e+110)) {
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 <= -2.5e+163) or not (y <= 4.3e+110): 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 <= -2.5e+163) || !(y <= 4.3e+110)) 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 <= -2.5e+163) || ~((y <= 4.3e+110))) 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, -2.5e+163], N[Not[LessEqual[y, 4.3e+110]], $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 -2.5 \cdot 10^{+163} \lor \neg \left(y \leq 4.3 \cdot 10^{+110}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -9.2e-5) (not (<= b 6.5e-22))) (* x (exp (* a (- b)))) (* x (exp (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9.2e-5) || !(b <= 6.5e-22)) {
tmp = x * exp((a * -b));
} else {
tmp = x * exp((t * -y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-9.2d-5)) .or. (.not. (b <= 6.5d-22))) then
tmp = x * exp((a * -b))
else
tmp = x * exp((t * -y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9.2e-5) || !(b <= 6.5e-22)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -9.2e-5) or not (b <= 6.5e-22): tmp = x * math.exp((a * -b)) else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -9.2e-5) || !(b <= 6.5e-22)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * exp(Float64(t * Float64(-y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -9.2e-5) || ~((b <= 6.5e-22))) tmp = x * exp((a * -b)); else tmp = x * exp((t * -y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9.2e-5], N[Not[LessEqual[b, 6.5e-22]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.2 \cdot 10^{-5} \lor \neg \left(b \leq 6.5 \cdot 10^{-22}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* t (- y)) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((t * -y) - (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(((t * -y) - (a * b)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((t * -y) - (a * b)));
}
def code(x, y, z, t, a, b): return x * math.exp(((t * -y) - (a * b)))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(t * Float64(-y)) - Float64(a * b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((t * -y) - (a * b))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(t * (-y)), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{t \cdot \left(-y\right) - a \cdot b}
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.2e-41) (not (<= y 3.4e-5))) (* x (pow z y)) (* x (- 1.0 (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.2e-41) || !(y <= 3.4e-5)) {
tmp = x * pow(z, y);
} else {
tmp = x * (1.0 - (a * (z + b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6.2d-41)) .or. (.not. (y <= 3.4d-5))) then
tmp = x * (z ** y)
else
tmp = x * (1.0d0 - (a * (z + b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.2e-41) || !(y <= 3.4e-5)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * (1.0 - (a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.2e-41) or not (y <= 3.4e-5): tmp = x * math.pow(z, y) else: tmp = x * (1.0 - (a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.2e-41) || !(y <= 3.4e-5)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.2e-41) || ~((y <= 3.4e-5))) tmp = x * (z ^ y); else tmp = x * (1.0 - (a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.2e-41], N[Not[LessEqual[y, 3.4e-5]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-41} \lor \neg \left(y \leq 3.4 \cdot 10^{-5}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\end{array}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* x (- z)))))
(if (<= y -1.65e-8)
t_1
(if (<= y 4.8e-41)
x
(if (<= y 1.12e+107)
(* b (* x (- a)))
(if (<= y 2.8e+230) t_1 (* a (* x (- b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (x * -z);
double tmp;
if (y <= -1.65e-8) {
tmp = t_1;
} else if (y <= 4.8e-41) {
tmp = x;
} else if (y <= 1.12e+107) {
tmp = b * (x * -a);
} else if (y <= 2.8e+230) {
tmp = t_1;
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (x * -z)
if (y <= (-1.65d-8)) then
tmp = t_1
else if (y <= 4.8d-41) then
tmp = x
else if (y <= 1.12d+107) then
tmp = b * (x * -a)
else if (y <= 2.8d+230) then
tmp = t_1
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (x * -z);
double tmp;
if (y <= -1.65e-8) {
tmp = t_1;
} else if (y <= 4.8e-41) {
tmp = x;
} else if (y <= 1.12e+107) {
tmp = b * (x * -a);
} else if (y <= 2.8e+230) {
tmp = t_1;
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (x * -z) tmp = 0 if y <= -1.65e-8: tmp = t_1 elif y <= 4.8e-41: tmp = x elif y <= 1.12e+107: tmp = b * (x * -a) elif y <= 2.8e+230: tmp = t_1 else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(x * Float64(-z))) tmp = 0.0 if (y <= -1.65e-8) tmp = t_1; elseif (y <= 4.8e-41) tmp = x; elseif (y <= 1.12e+107) tmp = Float64(b * Float64(x * Float64(-a))); elseif (y <= 2.8e+230) tmp = t_1; else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (x * -z); tmp = 0.0; if (y <= -1.65e-8) tmp = t_1; elseif (y <= 4.8e-41) tmp = x; elseif (y <= 1.12e+107) tmp = b * (x * -a); elseif (y <= 2.8e+230) tmp = t_1; else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.65e-8], t$95$1, If[LessEqual[y, 4.8e-41], x, If[LessEqual[y, 1.12e+107], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+230], t$95$1, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-41}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+107}:\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+230}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (* a (- b)))))
(if (<= y -1.05e-10)
t_1
(if (<= y 4.6e-41)
x
(if (<= y 1.7e+128)
t_1
(if (<= y 1.15e+230) (* a (* x (- z))) (* a (* x (- b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (a * -b);
double tmp;
if (y <= -1.05e-10) {
tmp = t_1;
} else if (y <= 4.6e-41) {
tmp = x;
} else if (y <= 1.7e+128) {
tmp = t_1;
} else if (y <= 1.15e+230) {
tmp = a * (x * -z);
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (a * -b)
if (y <= (-1.05d-10)) then
tmp = t_1
else if (y <= 4.6d-41) then
tmp = x
else if (y <= 1.7d+128) then
tmp = t_1
else if (y <= 1.15d+230) then
tmp = a * (x * -z)
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (a * -b);
double tmp;
if (y <= -1.05e-10) {
tmp = t_1;
} else if (y <= 4.6e-41) {
tmp = x;
} else if (y <= 1.7e+128) {
tmp = t_1;
} else if (y <= 1.15e+230) {
tmp = a * (x * -z);
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (a * -b) tmp = 0 if y <= -1.05e-10: tmp = t_1 elif y <= 4.6e-41: tmp = x elif y <= 1.7e+128: tmp = t_1 elif y <= 1.15e+230: tmp = a * (x * -z) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(a * Float64(-b))) tmp = 0.0 if (y <= -1.05e-10) tmp = t_1; elseif (y <= 4.6e-41) tmp = x; elseif (y <= 1.7e+128) tmp = t_1; elseif (y <= 1.15e+230) tmp = Float64(a * Float64(x * Float64(-z))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (a * -b); tmp = 0.0; if (y <= -1.05e-10) tmp = t_1; elseif (y <= 4.6e-41) tmp = x; elseif (y <= 1.7e+128) tmp = t_1; elseif (y <= 1.15e+230) tmp = a * (x * -z); else tmp = a * (x * -b); 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[y, -1.05e-10], t$95$1, If[LessEqual[y, 4.6e-41], x, If[LessEqual[y, 1.7e+128], t$95$1, If[LessEqual[y, 1.15e+230], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-41}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+230}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (* a (- b)))))
(if (<= y -7.2e-10)
t_1
(if (<= y 7.6e-42)
(* x (- 1.0 (* z a)))
(if (<= y 2.4e+127)
t_1
(if (<= y 2.9e+230) (* a (* x (- z))) (* a (* x (- b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (a * -b);
double tmp;
if (y <= -7.2e-10) {
tmp = t_1;
} else if (y <= 7.6e-42) {
tmp = x * (1.0 - (z * a));
} else if (y <= 2.4e+127) {
tmp = t_1;
} else if (y <= 2.9e+230) {
tmp = a * (x * -z);
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (a * -b)
if (y <= (-7.2d-10)) then
tmp = t_1
else if (y <= 7.6d-42) then
tmp = x * (1.0d0 - (z * a))
else if (y <= 2.4d+127) then
tmp = t_1
else if (y <= 2.9d+230) then
tmp = a * (x * -z)
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (a * -b);
double tmp;
if (y <= -7.2e-10) {
tmp = t_1;
} else if (y <= 7.6e-42) {
tmp = x * (1.0 - (z * a));
} else if (y <= 2.4e+127) {
tmp = t_1;
} else if (y <= 2.9e+230) {
tmp = a * (x * -z);
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (a * -b) tmp = 0 if y <= -7.2e-10: tmp = t_1 elif y <= 7.6e-42: tmp = x * (1.0 - (z * a)) elif y <= 2.4e+127: tmp = t_1 elif y <= 2.9e+230: tmp = a * (x * -z) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(a * Float64(-b))) tmp = 0.0 if (y <= -7.2e-10) tmp = t_1; elseif (y <= 7.6e-42) tmp = Float64(x * Float64(1.0 - Float64(z * a))); elseif (y <= 2.4e+127) tmp = t_1; elseif (y <= 2.9e+230) tmp = Float64(a * Float64(x * Float64(-z))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (a * -b); tmp = 0.0; if (y <= -7.2e-10) tmp = t_1; elseif (y <= 7.6e-42) tmp = x * (1.0 - (z * a)); elseif (y <= 2.4e+127) tmp = t_1; elseif (y <= 2.9e+230) tmp = a * (x * -z); else tmp = a * (x * -b); 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[y, -7.2e-10], t$95$1, If[LessEqual[y, 7.6e-42], N[(x * N[(1.0 - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e+127], t$95$1, If[LessEqual[y, 2.9e+230], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-42}:\\
\;\;\;\;x \cdot \left(1 - z \cdot a\right)\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+127}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+230}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(if (<= y 2.3)
(* x (- 1.0 (* a b)))
(if (<= y 1.35e+49)
(* x (* z (- a)))
(if (<= y 2.5e+126) (* x (* a (- b))) (* a (* x (- z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.3) {
tmp = x * (1.0 - (a * b));
} else if (y <= 1.35e+49) {
tmp = x * (z * -a);
} else if (y <= 2.5e+126) {
tmp = x * (a * -b);
} else {
tmp = a * (x * -z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 2.3d0) then
tmp = x * (1.0d0 - (a * b))
else if (y <= 1.35d+49) then
tmp = x * (z * -a)
else if (y <= 2.5d+126) then
tmp = x * (a * -b)
else
tmp = a * (x * -z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.3) {
tmp = x * (1.0 - (a * b));
} else if (y <= 1.35e+49) {
tmp = x * (z * -a);
} else if (y <= 2.5e+126) {
tmp = x * (a * -b);
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.3: tmp = x * (1.0 - (a * b)) elif y <= 1.35e+49: tmp = x * (z * -a) elif y <= 2.5e+126: tmp = x * (a * -b) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.3) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (y <= 1.35e+49) tmp = Float64(x * Float64(z * Float64(-a))); elseif (y <= 2.5e+126) tmp = Float64(x * Float64(a * Float64(-b))); else tmp = Float64(a * Float64(x * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.3) tmp = x * (1.0 - (a * b)); elseif (y <= 1.35e+49) tmp = x * (z * -a); elseif (y <= 2.5e+126) tmp = x * (a * -b); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.3], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+49], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+126], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+126}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(if (<= y 11.0)
(* x (- 1.0 (* a (+ z b))))
(if (<= y 5.8e+52)
(* x (* z (- a)))
(if (<= y 2.7e+120) (* x (* a (- b))) (* a (* x (- z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 11.0) {
tmp = x * (1.0 - (a * (z + b)));
} else if (y <= 5.8e+52) {
tmp = x * (z * -a);
} else if (y <= 2.7e+120) {
tmp = x * (a * -b);
} else {
tmp = a * (x * -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 <= 11.0d0) then
tmp = x * (1.0d0 - (a * (z + b)))
else if (y <= 5.8d+52) then
tmp = x * (z * -a)
else if (y <= 2.7d+120) then
tmp = x * (a * -b)
else
tmp = a * (x * -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 <= 11.0) {
tmp = x * (1.0 - (a * (z + b)));
} else if (y <= 5.8e+52) {
tmp = x * (z * -a);
} else if (y <= 2.7e+120) {
tmp = x * (a * -b);
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 11.0: tmp = x * (1.0 - (a * (z + b))) elif y <= 5.8e+52: tmp = x * (z * -a) elif y <= 2.7e+120: tmp = x * (a * -b) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 11.0) tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b)))); elseif (y <= 5.8e+52) tmp = Float64(x * Float64(z * Float64(-a))); elseif (y <= 2.7e+120) tmp = Float64(x * Float64(a * Float64(-b))); else tmp = Float64(a * Float64(x * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 11.0) tmp = x * (1.0 - (a * (z + b))); elseif (y <= 5.8e+52) tmp = x * (z * -a); elseif (y <= 2.7e+120) tmp = x * (a * -b); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 11.0], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e+52], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+120], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 11:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+52}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+120}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.1e-8) (not (<= y 8.8e-41))) (* a (* x (- z))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.1e-8) || !(y <= 8.8e-41)) {
tmp = a * (x * -z);
} 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 <= (-1.1d-8)) .or. (.not. (y <= 8.8d-41))) then
tmp = a * (x * -z)
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 <= -1.1e-8) || !(y <= 8.8e-41)) {
tmp = a * (x * -z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.1e-8) or not (y <= 8.8e-41): tmp = a * (x * -z) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.1e-8) || !(y <= 8.8e-41)) tmp = Float64(a * Float64(x * Float64(-z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.1e-8) || ~((y <= 8.8e-41))) tmp = a * (x * -z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.1e-8], N[Not[LessEqual[y, 8.8e-41]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-8} \lor \neg \left(y \leq 8.8 \cdot 10^{-41}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
herbie shell --seed 2023350
(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))))))