
(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 88.2%
+-commutative88.2%
associate--l+88.2%
fma-def88.2%
sub-neg88.2%
log1p-def99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (- (+ (* x (log y)) (* -0.5 (* z (pow y 2.0)))) (* z y)) t))
double code(double x, double y, double z, double t) {
return (((x * log(y)) + (-0.5 * (z * pow(y, 2.0)))) - (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)) + ((-0.5d0) * (z * (y ** 2.0d0)))) - (z * y)) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) + (-0.5 * (z * Math.pow(y, 2.0)))) - (z * y)) - t;
}
def code(x, y, z, t): return (((x * math.log(y)) + (-0.5 * (z * math.pow(y, 2.0)))) - (z * y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) + Float64(-0.5 * Float64(z * (y ^ 2.0)))) - Float64(z * y)) - t) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) + (-0.5 * (z * (y ^ 2.0)))) - (z * y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[(z * N[Power[y, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y + -0.5 \cdot \left(z \cdot {y}^{2}\right)\right) - z \cdot y\right) - t
\end{array}
Initial program 88.2%
Taylor expanded in y around 0 99.4%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (- (fma (- y) z (* x (log y))) t))
double code(double x, double y, double z, double t) {
return fma(-y, z, (x * log(y))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(-y), z, Float64(x * log(y))) - t) end
code[x_, y_, z_, t_] := N[(N[((-y) * z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-y, z, x \cdot \log y\right) - t
\end{array}
Initial program 88.2%
Taylor expanded in y around 0 99.3%
mul-1-neg99.3%
Simplified99.3%
+-commutative99.3%
*-commutative99.3%
fma-def99.3%
Applied egg-rr99.3%
Final simplification99.3%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -3.2e+26)
(not
(or (<= x 6e-13) (and (not (<= x 180000000.0)) (<= x 1.22e+116)))))
(* x (log y))
(- (* y (- z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.2e+26) || !((x <= 6e-13) || (!(x <= 180000000.0) && (x <= 1.22e+116)))) {
tmp = x * log(y);
} else {
tmp = (y * -z) - 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 <= (-3.2d+26)) .or. (.not. (x <= 6d-13) .or. (.not. (x <= 180000000.0d0)) .and. (x <= 1.22d+116))) then
tmp = x * log(y)
else
tmp = (y * -z) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.2e+26) || !((x <= 6e-13) || (!(x <= 180000000.0) && (x <= 1.22e+116)))) {
tmp = x * Math.log(y);
} else {
tmp = (y * -z) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.2e+26) or not ((x <= 6e-13) or (not (x <= 180000000.0) and (x <= 1.22e+116))): tmp = x * math.log(y) else: tmp = (y * -z) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.2e+26) || !((x <= 6e-13) || (!(x <= 180000000.0) && (x <= 1.22e+116)))) tmp = Float64(x * log(y)); else tmp = Float64(Float64(y * Float64(-z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.2e+26) || ~(((x <= 6e-13) || (~((x <= 180000000.0)) && (x <= 1.22e+116))))) tmp = x * log(y); else tmp = (y * -z) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.2e+26], N[Not[Or[LessEqual[x, 6e-13], And[N[Not[LessEqual[x, 180000000.0]], $MachinePrecision], LessEqual[x, 1.22e+116]]]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+26} \lor \neg \left(x \leq 6 \cdot 10^{-13} \lor \neg \left(x \leq 180000000\right) \land x \leq 1.22 \cdot 10^{+116}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\end{array}
\end{array}
if x < -3.20000000000000029e26 or 5.99999999999999968e-13 < x < 1.8e8 or 1.21999999999999993e116 < x Initial program 98.8%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around inf 86.3%
if -3.20000000000000029e26 < x < 5.99999999999999968e-13 or 1.8e8 < x < 1.21999999999999993e116Initial program 81.2%
Taylor expanded in y around 0 99.1%
mul-1-neg99.1%
Simplified99.1%
Taylor expanded in x around 0 84.4%
associate-*r*84.4%
neg-mul-184.4%
*-commutative84.4%
Simplified84.4%
Final simplification85.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -3.8e+25)
t_1
(if (<= x 1.8e-11)
(- (fma y z t))
(if (or (<= x 110000000000.0) (not (<= x 2.9e+114)))
t_1
(- (* y (- z)) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -3.8e+25) {
tmp = t_1;
} else if (x <= 1.8e-11) {
tmp = -fma(y, z, t);
} else if ((x <= 110000000000.0) || !(x <= 2.9e+114)) {
tmp = t_1;
} else {
tmp = (y * -z) - t;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -3.8e+25) tmp = t_1; elseif (x <= 1.8e-11) tmp = Float64(-fma(y, z, t)); elseif ((x <= 110000000000.0) || !(x <= 2.9e+114)) tmp = t_1; else tmp = Float64(Float64(y * Float64(-z)) - t); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+25], t$95$1, If[LessEqual[x, 1.8e-11], (-N[(y * z + t), $MachinePrecision]), If[Or[LessEqual[x, 110000000000.0], N[Not[LessEqual[x, 2.9e+114]], $MachinePrecision]], t$95$1, N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-11}:\\
\;\;\;\;-\mathsf{fma}\left(y, z, t\right)\\
\mathbf{elif}\;x \leq 110000000000 \lor \neg \left(x \leq 2.9 \cdot 10^{+114}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\end{array}
\end{array}
if x < -3.8e25 or 1.79999999999999992e-11 < x < 1.1e11 or 2.9e114 < x Initial program 98.8%
Taylor expanded in y around 0 99.6%
Taylor expanded in x around inf 86.3%
if -3.8e25 < x < 1.79999999999999992e-11Initial program 79.5%
Taylor expanded in y around 0 98.9%
mul-1-neg98.9%
Simplified98.9%
Taylor expanded in x around 0 86.3%
sub-neg86.3%
mul-1-neg86.3%
distribute-neg-out86.3%
fma-udef86.3%
Simplified86.3%
if 1.1e11 < x < 2.9e114Initial program 92.7%
Taylor expanded in y around 0 99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 71.7%
associate-*r*71.7%
neg-mul-171.7%
*-commutative71.7%
Simplified71.7%
Final simplification85.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.42e-68) (not (<= x 7.5e-116))) (- (* x (log y)) t) (- (* z (log1p (- y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.42e-68) || !(x <= 7.5e-116)) {
tmp = (x * log(y)) - t;
} else {
tmp = (z * log1p(-y)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.42e-68) || !(x <= 7.5e-116)) {
tmp = (x * Math.log(y)) - t;
} else {
tmp = (z * Math.log1p(-y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.42e-68) or not (x <= 7.5e-116): tmp = (x * math.log(y)) - t else: tmp = (z * math.log1p(-y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.42e-68) || !(x <= 7.5e-116)) tmp = Float64(Float64(x * log(y)) - t); else tmp = Float64(Float64(z * log1p(Float64(-y))) - t); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.42e-68], N[Not[LessEqual[x, 7.5e-116]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(z * N[Log[1 + (-y)], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.42 \cdot 10^{-68} \lor \neg \left(x \leq 7.5 \cdot 10^{-116}\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{log1p}\left(-y\right) - t\\
\end{array}
\end{array}
if x < -1.42e-68 or 7.5000000000000004e-116 < x Initial program 94.3%
Taylor expanded in y around 0 94.3%
if -1.42e-68 < x < 7.5000000000000004e-116Initial program 76.8%
Taylor expanded in x around 0 71.7%
sub-neg71.7%
mul-1-neg71.7%
log1p-def94.8%
mul-1-neg94.8%
Simplified94.8%
Final simplification94.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -9.2e-70) (not (<= x 6.8e-116))) (- (* x (log y)) t) (- (fma y z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.2e-70) || !(x <= 6.8e-116)) {
tmp = (x * log(y)) - t;
} else {
tmp = -fma(y, z, t);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((x <= -9.2e-70) || !(x <= 6.8e-116)) 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, -9.2e-70], N[Not[LessEqual[x, 6.8e-116]], $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 -9.2 \cdot 10^{-70} \lor \neg \left(x \leq 6.8 \cdot 10^{-116}\right):\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;-\mathsf{fma}\left(y, z, t\right)\\
\end{array}
\end{array}
if x < -9.20000000000000002e-70 or 6.79999999999999985e-116 < x Initial program 94.3%
Taylor expanded in y around 0 94.3%
if -9.20000000000000002e-70 < x < 6.79999999999999985e-116Initial program 76.8%
Taylor expanded in y around 0 98.5%
mul-1-neg98.5%
Simplified98.5%
Taylor expanded in x around 0 93.4%
sub-neg93.4%
mul-1-neg93.4%
distribute-neg-out93.4%
fma-udef93.4%
Simplified93.4%
Final simplification94.0%
(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 88.2%
Taylor expanded in y around 0 99.3%
mul-1-neg99.3%
Simplified99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.6e-173) (not (<= t 6.5e-81))) (- t) (* y (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.6e-173) || !(t <= 6.5e-81)) {
tmp = -t;
} else {
tmp = y * -z;
}
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 <= (-1.6d-173)) .or. (.not. (t <= 6.5d-81))) then
tmp = -t
else
tmp = y * -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.6e-173) || !(t <= 6.5e-81)) {
tmp = -t;
} else {
tmp = y * -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.6e-173) or not (t <= 6.5e-81): tmp = -t else: tmp = y * -z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.6e-173) || !(t <= 6.5e-81)) tmp = Float64(-t); else tmp = Float64(y * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.6e-173) || ~((t <= 6.5e-81))) tmp = -t; else tmp = y * -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.6e-173], N[Not[LessEqual[t, 6.5e-81]], $MachinePrecision]], (-t), N[(y * (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-173} \lor \neg \left(t \leq 6.5 \cdot 10^{-81}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\end{array}
\end{array}
if t < -1.6e-173 or 6.5000000000000002e-81 < t Initial program 93.4%
Taylor expanded in t around inf 58.1%
neg-mul-158.1%
Simplified58.1%
if -1.6e-173 < t < 6.5000000000000002e-81Initial program 73.8%
Taylor expanded in y around 0 97.7%
mul-1-neg97.7%
Simplified97.7%
Taylor expanded in y around inf 29.2%
associate-*r*29.2%
neg-mul-129.2%
*-commutative29.2%
Simplified29.2%
Final simplification50.3%
(FPCore (x y z t) :precision binary64 (- (* y (- z)) t))
double code(double x, double y, double z, double t) {
return (y * -z) - 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 = (y * -z) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * -z) - t;
}
def code(x, y, z, t): return (y * -z) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(-z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * -z) - t; end
code[x_, y_, z_, t_] := N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(-z\right) - t
\end{array}
Initial program 88.2%
Taylor expanded in y around 0 99.3%
mul-1-neg99.3%
Simplified99.3%
Taylor expanded in x around 0 56.4%
associate-*r*56.4%
neg-mul-156.4%
*-commutative56.4%
Simplified56.4%
Final simplification56.4%
(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 88.2%
Taylor expanded in t around inf 44.8%
neg-mul-144.8%
Simplified44.8%
Final simplification44.8%
(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 2023320
(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))