
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(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)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(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)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(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)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (or (<= t_2 -2e+31) (not (<= t_2 5e-8)))
(- t_1 (+ y z))
(- (log t) (+ y z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if ((t_2 <= -2e+31) || !(t_2 <= 5e-8)) {
tmp = t_1 - (y + z);
} else {
tmp = log(t) - (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if ((t_2 <= (-2d+31)) .or. (.not. (t_2 <= 5d-8))) then
tmp = t_1 - (y + z)
else
tmp = log(t) - (y + z)
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 t_2 = t_1 - y;
double tmp;
if ((t_2 <= -2e+31) || !(t_2 <= 5e-8)) {
tmp = t_1 - (y + z);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if (t_2 <= -2e+31) or not (t_2 <= 5e-8): tmp = t_1 - (y + z) else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if ((t_2 <= -2e+31) || !(t_2 <= 5e-8)) tmp = Float64(t_1 - Float64(y + z)); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if ((t_2 <= -2e+31) || ~((t_2 <= 5e-8))) tmp = t_1 - (y + z); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e+31], N[Not[LessEqual[t$95$2, 5e-8]], $MachinePrecision]], N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+31} \lor \neg \left(t\_2 \leq 5 \cdot 10^{-8}\right):\\
\;\;\;\;t\_1 - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.9999999999999999e31 or 4.9999999999999998e-8 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
if -1.9999999999999999e31 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.9999999999999998e-8Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 98.2%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 0.056) (- (+ (log t) t_1) z) (- t_1 (+ y z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 0.056) {
tmp = (log(t) + t_1) - z;
} else {
tmp = t_1 - (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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (y <= 0.056d0) then
tmp = (log(t) + t_1) - z
else
tmp = t_1 - (y + z)
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 (y <= 0.056) {
tmp = (Math.log(t) + t_1) - z;
} else {
tmp = t_1 - (y + z);
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 0.056: tmp = (math.log(t) + t_1) - z else: tmp = t_1 - (y + z) return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 0.056) tmp = Float64(Float64(log(t) + t_1) - z); else tmp = Float64(t_1 - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 0.056) tmp = (log(t) + t_1) - z; else tmp = t_1 - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.056], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - z), $MachinePrecision], N[(t$95$1 - N[(y + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 0.056:\\
\;\;\;\;\left(\log t + t\_1\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \left(y + z\right)\\
\end{array}
\end{array}
if y < 0.0560000000000000012Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around 0 99.3%
if 0.0560000000000000012 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.4%
Final simplification99.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1e+91)
t_1
(if (<= x 1.7e-262) (- y) (if (<= x 3.8e+33) (- z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1e+91) {
tmp = t_1;
} else if (x <= 1.7e-262) {
tmp = -y;
} else if (x <= 3.8e+33) {
tmp = -z;
} else {
tmp = t_1;
}
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 (x <= (-1d+91)) then
tmp = t_1
else if (x <= 1.7d-262) then
tmp = -y
else if (x <= 3.8d+33) then
tmp = -z
else
tmp = t_1
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 (x <= -1e+91) {
tmp = t_1;
} else if (x <= 1.7e-262) {
tmp = -y;
} else if (x <= 3.8e+33) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1e+91: tmp = t_1 elif x <= 1.7e-262: tmp = -y elif x <= 3.8e+33: tmp = -z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1e+91) tmp = t_1; elseif (x <= 1.7e-262) tmp = Float64(-y); elseif (x <= 3.8e+33) tmp = Float64(-z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -1e+91) tmp = t_1; elseif (x <= 1.7e-262) tmp = -y; elseif (x <= 3.8e+33) tmp = -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e+91], t$95$1, If[LessEqual[x, 1.7e-262], (-y), If[LessEqual[x, 3.8e+33], (-z), t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-262}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+33}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.00000000000000008e91 or 3.80000000000000002e33 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in y around inf 65.3%
Simplified65.2%
Taylor expanded in x around inf 73.2%
*-commutative73.2%
Simplified73.2%
if -1.00000000000000008e91 < x < 1.69999999999999995e-262Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 44.4%
mul-1-neg44.4%
Simplified44.4%
if 1.69999999999999995e-262 < x < 3.80000000000000002e33Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 42.9%
mul-1-neg42.9%
Simplified42.9%
Final simplification56.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1.35e+91)
t_1
(if (<= x -4.6) (- y) (if (<= x 2.1e+37) (- (log t) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.35e+91) {
tmp = t_1;
} else if (x <= -4.6) {
tmp = -y;
} else if (x <= 2.1e+37) {
tmp = log(t) - z;
} else {
tmp = t_1;
}
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 (x <= (-1.35d+91)) then
tmp = t_1
else if (x <= (-4.6d0)) then
tmp = -y
else if (x <= 2.1d+37) then
tmp = log(t) - z
else
tmp = t_1
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 (x <= -1.35e+91) {
tmp = t_1;
} else if (x <= -4.6) {
tmp = -y;
} else if (x <= 2.1e+37) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.35e+91: tmp = t_1 elif x <= -4.6: tmp = -y elif x <= 2.1e+37: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.35e+91) tmp = t_1; elseif (x <= -4.6) tmp = Float64(-y); elseif (x <= 2.1e+37) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -1.35e+91) tmp = t_1; elseif (x <= -4.6) tmp = -y; elseif (x <= 2.1e+37) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+91], t$95$1, If[LessEqual[x, -4.6], (-y), If[LessEqual[x, 2.1e+37], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.6:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+37}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.35e91 or 2.1000000000000001e37 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in y around inf 65.3%
Simplified65.2%
Taylor expanded in x around inf 73.2%
*-commutative73.2%
Simplified73.2%
if -1.35e91 < x < -4.5999999999999996Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 56.4%
mul-1-neg56.4%
Simplified56.4%
if -4.5999999999999996 < x < 2.1000000000000001e37Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 90.3%
Simplified90.3%
Taylor expanded in x around 0 89.3%
Taylor expanded in y around 0 64.9%
Final simplification67.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.04e+96) (not (<= x 6.6e+100))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.04e+96) || !(x <= 6.6e+100)) {
tmp = x * log(y);
} else {
tmp = log(t) - (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 ((x <= (-1.04d+96)) .or. (.not. (x <= 6.6d+100))) then
tmp = x * log(y)
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.04e+96) || !(x <= 6.6e+100)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.04e+96) or not (x <= 6.6e+100): tmp = x * math.log(y) else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.04e+96) || !(x <= 6.6e+100)) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.04e+96) || ~((x <= 6.6e+100))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.04e+96], N[Not[LessEqual[x, 6.6e+100]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.04 \cdot 10^{+96} \lor \neg \left(x \leq 6.6 \cdot 10^{+100}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.03999999999999996e96 or 6.6000000000000002e100 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in y around inf 61.9%
Simplified61.8%
Taylor expanded in x around inf 79.1%
*-commutative79.1%
Simplified79.1%
if -1.03999999999999996e96 < x < 6.6000000000000002e100Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 91.4%
Final simplification87.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.7e+94) (not (<= x 2.9e+32))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.7e+94) || !(x <= 2.9e+32)) {
tmp = (x * log(y)) - y;
} else {
tmp = log(t) - (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 ((x <= (-2.7d+94)) .or. (.not. (x <= 2.9d+32))) then
tmp = (x * log(y)) - y
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.7e+94) || !(x <= 2.9e+32)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.7e+94) or not (x <= 2.9e+32): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.7e+94) || !(x <= 2.9e+32)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.7e+94) || ~((x <= 2.9e+32))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.7e+94], N[Not[LessEqual[x, 2.9e+32]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+94} \lor \neg \left(x \leq 2.9 \cdot 10^{+32}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -2.7000000000000001e94 or 2.90000000000000003e32 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in y around inf 87.0%
if -2.7000000000000001e94 < x < 2.90000000000000003e32Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in x around 0 95.4%
Final simplification91.9%
(FPCore (x y z t) :precision binary64 (if (<= y 3.8e+33) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.8e+33) {
tmp = -z;
} else {
tmp = -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 (y <= 3.8d+33) then
tmp = -z
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.8e+33) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.8e+33: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.8e+33) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.8e+33) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.8e+33], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.8 \cdot 10^{+33}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 3.80000000000000002e33Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 36.5%
mul-1-neg36.5%
Simplified36.5%
if 3.80000000000000002e33 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 60.5%
mul-1-neg60.5%
Simplified60.5%
Final simplification46.5%
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
return -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 = -y
end function
public static double code(double x, double y, double z, double t) {
return -y;
}
def code(x, y, z, t): return -y
function code(x, y, z, t) return Float64(-y) end
function tmp = code(x, y, z, t) tmp = -y; end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 27.7%
mul-1-neg27.7%
Simplified27.7%
Final simplification27.7%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return 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 = y
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return y end
function tmp = code(x, y, z, t) tmp = y; end
code[x_, y_, z_, t_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in x around inf 83.1%
Taylor expanded in y around inf 19.6%
associate-*r/19.6%
neg-mul-119.6%
Simplified19.6%
clear-num19.5%
un-div-inv19.9%
add-sqr-sqrt0.0%
sqrt-unprod2.6%
sqr-neg2.6%
sqrt-unprod2.6%
add-sqr-sqrt2.6%
Applied egg-rr2.6%
associate-/r/2.6%
*-inverses2.6%
*-lft-identity2.6%
Simplified2.6%
Final simplification2.6%
herbie shell --seed 2024130
(FPCore (x y z t)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (- (* x (log y)) y) z) (log t)))