
(FPCore (x y z t) :precision binary64 (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return ((x * log(y)) + (z * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * log(y)) + (z * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) + (z * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return ((x * math.log(y)) + (z * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(x * log(y)) + Float64(z * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = ((x * log(y)) + (z * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return ((x * log(y)) + (z * log((1.0 - y)))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * log(y)) + (z * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) + (z * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return ((x * math.log(y)) + (z * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(x * log(y)) + Float64(z * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = ((x * log(y)) + (z * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (fma z (log1p (- y)) (- (* x (log y)) t)))
double code(double x, double y, double z, double t) {
return fma(z, log1p(-y), ((x * log(y)) - t));
}
function code(x, y, z, t) return fma(z, log1p(Float64(-y)), Float64(Float64(x * log(y)) - t)) end
code[x_, y_, z_, t_] := N[(z * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, \mathsf{log1p}\left(-y\right), x \cdot \log y - t\right)
\end{array}
Initial program 86.6%
+-commutative86.6%
associate--l+86.6%
fma-def86.6%
sub-neg86.6%
log1p-def99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (or (<= t -2.1e-13) (not (<= t 8e-62))) (- t_1 t) (- t_1 (* z y)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if ((t <= -2.1e-13) || !(t <= 8e-62)) {
tmp = t_1 - t;
} else {
tmp = t_1 - (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if ((t <= (-2.1d-13)) .or. (.not. (t <= 8d-62))) then
tmp = t_1 - t
else
tmp = t_1 - (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if ((t <= -2.1e-13) || !(t <= 8e-62)) {
tmp = t_1 - t;
} else {
tmp = t_1 - (z * y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if (t <= -2.1e-13) or not (t <= 8e-62): tmp = t_1 - t else: tmp = t_1 - (z * y) return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if ((t <= -2.1e-13) || !(t <= 8e-62)) tmp = Float64(t_1 - t); else tmp = Float64(t_1 - Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if ((t <= -2.1e-13) || ~((t <= 8e-62))) tmp = t_1 - t; else tmp = t_1 - (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -2.1e-13], N[Not[LessEqual[t, 8e-62]], $MachinePrecision]], N[(t$95$1 - t), $MachinePrecision], N[(t$95$1 - N[(z * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{-13} \lor \neg \left(t \leq 8 \cdot 10^{-62}\right):\\
\;\;\;\;t_1 - t\\
\mathbf{else}:\\
\;\;\;\;t_1 - z \cdot y\\
\end{array}
\end{array}
if t < -2.09999999999999989e-13 or 8.0000000000000003e-62 < t Initial program 98.2%
Taylor expanded in y around 0 97.7%
if -2.09999999999999989e-13 < t < 8.0000000000000003e-62Initial program 75.8%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
mul-1-neg99.0%
unsub-neg99.0%
Simplified99.0%
Taylor expanded in t around 0 92.5%
Final simplification95.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.5e-222) (not (<= x 1.15e-68))) (- (* x (log y)) t) (- (fma y z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.5e-222) || !(x <= 1.15e-68)) {
tmp = (x * log(y)) - t;
} else {
tmp = -fma(y, z, t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.5e-222) || !(x <= 1.15e-68)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(-fma(y, z, t)); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.5e-222], N[Not[LessEqual[x, 1.15e-68]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], (-N[(y * z + t), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-222} \lor \neg \left(x \leq 1.15 \cdot 10^{-68}\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;-\mathsf{fma}\left(y, z, t\right)\\
\end{array}
\end{array}
if x < -7.5000000000000004e-222 or 1.14999999999999998e-68 < x Initial program 93.7%
Taylor expanded in y around 0 93.2%
if -7.5000000000000004e-222 < x < 1.14999999999999998e-68Initial program 61.7%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
mul-1-neg98.8%
unsub-neg98.8%
Simplified98.8%
Taylor expanded in x around 0 93.7%
mul-1-neg93.7%
+-commutative93.7%
fma-udef93.8%
Simplified93.8%
Final simplification93.3%
(FPCore (x y z t) :precision binary64 (- (- (* x (log y)) (* z y)) t))
double code(double x, double y, double z, double t) {
return ((x * log(y)) - (z * y)) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * log(y)) - (z * y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) - (z * y)) - t;
}
def code(x, y, z, t): return ((x * math.log(y)) - (z * y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(x * log(y)) - Float64(z * y)) - t) end
function tmp = code(x, y, z, t) tmp = ((x * log(y)) - (z * y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \log y - z \cdot y\right) - t
\end{array}
Initial program 86.6%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
mul-1-neg99.3%
unsub-neg99.3%
Simplified99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.72e+15) (not (<= x 1.06e+65))) (* x (log y)) (- (fma y z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.72e+15) || !(x <= 1.06e+65)) {
tmp = x * log(y);
} else {
tmp = -fma(y, z, t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.72e+15) || !(x <= 1.06e+65)) tmp = Float64(x * log(y)); else tmp = Float64(-fma(y, z, t)); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.72e+15], N[Not[LessEqual[x, 1.06e+65]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], (-N[(y * z + t), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.72 \cdot 10^{+15} \lor \neg \left(x \leq 1.06 \cdot 10^{+65}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;-\mathsf{fma}\left(y, z, t\right)\\
\end{array}
\end{array}
if x < -1.72e15 or 1.06e65 < x Initial program 97.1%
flip3--97.1%
log-div97.1%
metadata-eval97.1%
pow397.1%
sub-neg97.1%
distribute-rgt-neg-out97.1%
add-sqr-sqrt0.0%
sqrt-unprod97.1%
sqr-neg97.1%
sqrt-unprod97.1%
add-sqr-sqrt97.1%
log1p-udef97.1%
pow397.1%
metadata-eval97.1%
log1p-udef99.7%
*-un-lft-identity99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 78.7%
if -1.72e15 < x < 1.06e65Initial program 79.2%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
mul-1-neg99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in x around 0 81.5%
mul-1-neg81.5%
+-commutative81.5%
fma-udef81.5%
Simplified81.5%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -42000000000000.0) (not (<= x 7.6e+66))) (* x (log y)) (- (* z (- y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -42000000000000.0) || !(x <= 7.6e+66)) {
tmp = x * log(y);
} else {
tmp = (z * -y) - t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-42000000000000.0d0)) .or. (.not. (x <= 7.6d+66))) then
tmp = x * log(y)
else
tmp = (z * -y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -42000000000000.0) || !(x <= 7.6e+66)) {
tmp = x * Math.log(y);
} else {
tmp = (z * -y) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -42000000000000.0) or not (x <= 7.6e+66): tmp = x * math.log(y) else: tmp = (z * -y) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -42000000000000.0) || !(x <= 7.6e+66)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(z * Float64(-y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -42000000000000.0) || ~((x <= 7.6e+66))) tmp = x * log(y); else tmp = (z * -y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -42000000000000.0], N[Not[LessEqual[x, 7.6e+66]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -42000000000000 \lor \neg \left(x \leq 7.6 \cdot 10^{+66}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\end{array}
\end{array}
if x < -4.2e13 or 7.6000000000000004e66 < x Initial program 97.1%
flip3--97.1%
log-div97.1%
metadata-eval97.1%
pow397.1%
sub-neg97.1%
distribute-rgt-neg-out97.1%
add-sqr-sqrt0.0%
sqrt-unprod97.1%
sqr-neg97.1%
sqrt-unprod97.1%
add-sqr-sqrt97.1%
log1p-udef97.1%
pow397.1%
metadata-eval97.1%
log1p-udef99.7%
*-un-lft-identity99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 78.7%
if -4.2e13 < x < 7.6000000000000004e66Initial program 79.2%
Taylor expanded in x around 0 61.3%
Taylor expanded in y around 0 81.5%
associate-*r*81.5%
mul-1-neg81.5%
Simplified81.5%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -3.9e-59) (not (<= t 3e-60))) (- t) (* z (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.9e-59) || !(t <= 3e-60)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-3.9d-59)) .or. (.not. (t <= 3d-60))) then
tmp = -t
else
tmp = z * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.9e-59) || !(t <= 3e-60)) {
tmp = -t;
} else {
tmp = z * -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -3.9e-59) or not (t <= 3e-60): tmp = -t else: tmp = z * -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -3.9e-59) || !(t <= 3e-60)) tmp = Float64(-t); else tmp = Float64(z * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -3.9e-59) || ~((t <= 3e-60))) tmp = -t; else tmp = z * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.9e-59], N[Not[LessEqual[t, 3e-60]], $MachinePrecision]], (-t), N[(z * (-y)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.9 \cdot 10^{-59} \lor \neg \left(t \leq 3 \cdot 10^{-60}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\end{array}
\end{array}
if t < -3.90000000000000019e-59 or 3.00000000000000019e-60 < t Initial program 98.2%
Taylor expanded in t around inf 75.8%
neg-mul-175.8%
Simplified75.8%
if -3.90000000000000019e-59 < t < 3.00000000000000019e-60Initial program 74.4%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
mul-1-neg99.0%
unsub-neg99.0%
Simplified99.0%
Taylor expanded in y around inf 28.7%
mul-1-neg28.7%
*-commutative28.7%
distribute-rgt-neg-in28.7%
Simplified28.7%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (if (<= t -3.45e-59) (- (* z y) t) (if (<= t 2.15e-61) (* z (- y)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.45e-59) {
tmp = (z * y) - t;
} else if (t <= 2.15e-61) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-3.45d-59)) then
tmp = (z * y) - t
else if (t <= 2.15d-61) then
tmp = z * -y
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.45e-59) {
tmp = (z * y) - t;
} else if (t <= 2.15e-61) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.45e-59: tmp = (z * y) - t elif t <= 2.15e-61: tmp = z * -y else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.45e-59) tmp = Float64(Float64(z * y) - t); elseif (t <= 2.15e-61) tmp = Float64(z * Float64(-y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -3.45e-59) tmp = (z * y) - t; elseif (t <= 2.15e-61) tmp = z * -y; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.45e-59], N[(N[(z * y), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 2.15e-61], N[(z * (-y)), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.45 \cdot 10^{-59}:\\
\;\;\;\;z \cdot y - t\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{-61}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -3.44999999999999991e-59Initial program 99.2%
Taylor expanded in x around 0 74.5%
Taylor expanded in y around 0 74.7%
associate-*r*74.7%
mul-1-neg74.7%
Simplified74.7%
sub-neg74.7%
add-sqr-sqrt0.0%
sqrt-unprod73.7%
sqr-neg73.7%
sqrt-unprod73.8%
add-sqr-sqrt73.8%
Applied egg-rr73.8%
sub-neg73.8%
Simplified73.8%
if -3.44999999999999991e-59 < t < 2.1500000000000002e-61Initial program 74.4%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
mul-1-neg99.0%
unsub-neg99.0%
Simplified99.0%
Taylor expanded in y around inf 28.7%
mul-1-neg28.7%
*-commutative28.7%
distribute-rgt-neg-in28.7%
Simplified28.7%
if 2.1500000000000002e-61 < t Initial program 97.1%
Taylor expanded in t around inf 78.2%
neg-mul-178.2%
Simplified78.2%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (- (* z (- y)) t))
double code(double x, double y, double z, double t) {
return (z * -y) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (z * -y) - t
end function
public static double code(double x, double y, double z, double t) {
return (z * -y) - t;
}
def code(x, y, z, t): return (z * -y) - t
function code(x, y, z, t) return Float64(Float64(z * Float64(-y)) - t) end
function tmp = code(x, y, z, t) tmp = (z * -y) - t; end
code[x_, y_, z_, t_] := N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(-y\right) - t
\end{array}
Initial program 86.6%
Taylor expanded in x around 0 44.4%
Taylor expanded in y around 0 57.1%
associate-*r*57.1%
mul-1-neg57.1%
Simplified57.1%
Final simplification57.1%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t
end function
public static double code(double x, double y, double z, double t) {
return -t;
}
def code(x, y, z, t): return -t
function code(x, y, z, t) return Float64(-t) end
function tmp = code(x, y, z, t) tmp = -t; end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 86.6%
Taylor expanded in t around inf 43.6%
neg-mul-143.6%
Simplified43.6%
Final simplification43.6%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 86.6%
Taylor expanded in y around 0 85.8%
fma-neg85.8%
Simplified85.8%
add-sqr-sqrt44.2%
pow244.2%
add-sqr-sqrt35.8%
sqrt-unprod35.6%
sqr-neg35.6%
sqrt-unprod8.8%
add-sqr-sqrt23.5%
Applied egg-rr23.5%
Taylor expanded in x around 0 2.2%
Final simplification2.2%
(FPCore (x y z t)
:precision binary64
(-
(*
(- z)
(+
(+ (* 0.5 (* y y)) y)
(* (/ 0.3333333333333333 (* 1.0 (* 1.0 1.0))) (* y (* y y)))))
(- t (* x (log y)))))
double code(double x, double y, double z, double t) {
return (-z * (((0.5 * (y * y)) + y) + ((0.3333333333333333 / (1.0 * (1.0 * 1.0))) * (y * (y * y))))) - (t - (x * log(y)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (-z * (((0.5d0 * (y * y)) + y) + ((0.3333333333333333d0 / (1.0d0 * (1.0d0 * 1.0d0))) * (y * (y * y))))) - (t - (x * log(y)))
end function
public static double code(double x, double y, double z, double t) {
return (-z * (((0.5 * (y * y)) + y) + ((0.3333333333333333 / (1.0 * (1.0 * 1.0))) * (y * (y * y))))) - (t - (x * Math.log(y)));
}
def code(x, y, z, t): return (-z * (((0.5 * (y * y)) + y) + ((0.3333333333333333 / (1.0 * (1.0 * 1.0))) * (y * (y * y))))) - (t - (x * math.log(y)))
function code(x, y, z, t) return Float64(Float64(Float64(-z) * Float64(Float64(Float64(0.5 * Float64(y * y)) + y) + Float64(Float64(0.3333333333333333 / Float64(1.0 * Float64(1.0 * 1.0))) * Float64(y * Float64(y * y))))) - Float64(t - Float64(x * log(y)))) end
function tmp = code(x, y, z, t) tmp = (-z * (((0.5 * (y * y)) + y) + ((0.3333333333333333 / (1.0 * (1.0 * 1.0))) * (y * (y * y))))) - (t - (x * log(y))); end
code[x_, y_, z_, t_] := N[(N[((-z) * N[(N[(N[(0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + N[(N[(0.3333333333333333 / N[(1.0 * N[(1.0 * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t - N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-z\right) \cdot \left(\left(0.5 \cdot \left(y \cdot y\right) + y\right) + \frac{0.3333333333333333}{1 \cdot \left(1 \cdot 1\right)} \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) - \left(t - x \cdot \log y\right)
\end{array}
herbie shell --seed 2023318
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(- (* (- z) (+ (+ (* 0.5 (* y y)) y) (* (/ 0.3333333333333333 (* 1.0 (* 1.0 1.0))) (* y (* y y))))) (- t (* x (log y))))
(- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))