
(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 (+ (log t) (- (- (* (log y) x) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((log(y) * x) - y) - z);
}
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 = log(t) + (((log(y) * x) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((Math.log(y) * x) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((math.log(y) * x) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(log(y) * x) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((log(y) * x) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(\log y \cdot x - y\right) - z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* (log y) x) y)) (t_2 (fma (log y) x (log t))))
(if (<= t_1 -2e+121)
(- t_2 y)
(if (<= t_1 -20.0) (- (- (log t) y) z) (- t_2 z)))))
double code(double x, double y, double z, double t) {
double t_1 = (log(y) * x) - y;
double t_2 = fma(log(y), x, log(t));
double tmp;
if (t_1 <= -2e+121) {
tmp = t_2 - y;
} else if (t_1 <= -20.0) {
tmp = (log(t) - y) - z;
} else {
tmp = t_2 - z;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(log(y) * x) - y) t_2 = fma(log(y), x, log(t)) tmp = 0.0 if (t_1 <= -2e+121) tmp = Float64(t_2 - y); elseif (t_1 <= -20.0) tmp = Float64(Float64(log(t) - y) - z); else tmp = Float64(t_2 - z); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+121], N[(t$95$2 - y), $MachinePrecision], If[LessEqual[t$95$1, -20.0], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(t$95$2 - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x - y\\
t_2 := \mathsf{fma}\left(\log y, x, \log t\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+121}:\\
\;\;\;\;t\_2 - y\\
\mathbf{elif}\;t\_1 \leq -20:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_2 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -2.00000000000000007e121Initial program 99.9%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6491.2
Applied rewrites91.2%
if -2.00000000000000007e121 < (-.f64 (*.f64 x (log.f64 y)) y) < -20Initial program 99.9%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6488.6
Applied rewrites88.6%
if -20 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6498.8
Applied rewrites98.8%
Final simplification94.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (- (* (log y) x) y) z))) (if (<= t_1 -2000.0) (- y) (if (<= t_1 20.0) (log t) (- z)))))
double code(double x, double y, double z, double t) {
double t_1 = ((log(y) * x) - y) - z;
double tmp;
if (t_1 <= -2000.0) {
tmp = -y;
} else if (t_1 <= 20.0) {
tmp = log(t);
} else {
tmp = -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 = ((log(y) * x) - y) - z
if (t_1 <= (-2000.0d0)) then
tmp = -y
else if (t_1 <= 20.0d0) then
tmp = log(t)
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((Math.log(y) * x) - y) - z;
double tmp;
if (t_1 <= -2000.0) {
tmp = -y;
} else if (t_1 <= 20.0) {
tmp = Math.log(t);
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((math.log(y) * x) - y) - z tmp = 0 if t_1 <= -2000.0: tmp = -y elif t_1 <= 20.0: tmp = math.log(t) else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(log(y) * x) - y) - z) tmp = 0.0 if (t_1 <= -2000.0) tmp = Float64(-y); elseif (t_1 <= 20.0) tmp = log(t); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((log(y) * x) - y) - z; tmp = 0.0; if (t_1 <= -2000.0) tmp = -y; elseif (t_1 <= 20.0) tmp = log(t); else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[t$95$1, -2000.0], (-y), If[LessEqual[t$95$1, 20.0], N[Log[t], $MachinePrecision], (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\log y \cdot x - y\right) - z\\
\mathbf{if}\;t\_1 \leq -2000:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_1 \leq 20:\\
\;\;\;\;\log t\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -2e3Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6449.7
Applied rewrites49.7%
if -2e3 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 20Initial program 100.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6499.0
Applied rewrites99.0%
Taylor expanded in z around 0
Applied rewrites96.8%
Taylor expanded in x around 0
Applied rewrites91.8%
if 20 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6450.2
Applied rewrites50.2%
Final simplification55.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (log y) x)) (t_2 (- t_1 y))) (if (<= t_2 -2e+49) (- y) (if (<= t_2 2e+73) (- (log t) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+49) {
tmp = -y;
} else if (t_2 <= 2e+73) {
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) :: t_2
real(8) :: tmp
t_1 = log(y) * x
t_2 = t_1 - y
if (t_2 <= (-2d+49)) then
tmp = -y
else if (t_2 <= 2d+73) 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 = Math.log(y) * x;
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -2e+49) {
tmp = -y;
} else if (t_2 <= 2e+73) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x t_2 = t_1 - y tmp = 0 if t_2 <= -2e+49: tmp = -y elif t_2 <= 2e+73: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -2e+49) tmp = Float64(-y); elseif (t_2 <= 2e+73) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -2e+49) tmp = -y; elseif (t_2 <= 2e+73) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+49], (-y), If[LessEqual[t$95$2, 2e+73], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+49}:\\
\;\;\;\;-y\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+73}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -1.99999999999999989e49Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6456.3
Applied rewrites56.3%
if -1.99999999999999989e49 < (-.f64 (*.f64 x (log.f64 y)) y) < 1.99999999999999997e73Initial program 100.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6494.7
Applied rewrites94.7%
Taylor expanded in x around 0
Applied rewrites88.9%
if 1.99999999999999997e73 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6487.0
Applied rewrites87.0%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (fma (log y) x (log t)) y))) (if (<= x -3.2e+100) t_1 (if (<= x 4e+44) (- (- (log t) y) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(log(y), x, log(t)) - y;
double tmp;
if (x <= -3.2e+100) {
tmp = t_1;
} else if (x <= 4e+44) {
tmp = (log(t) - y) - z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(fma(log(y), x, log(t)) - y) tmp = 0.0 if (x <= -3.2e+100) tmp = t_1; elseif (x <= 4e+44) tmp = Float64(Float64(log(t) - y) - z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x + N[Log[t], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -3.2e+100], t$95$1, If[LessEqual[x, 4e+44], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\log y, x, \log t\right) - y\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+44}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.1999999999999999e100 or 4.0000000000000004e44 < x Initial program 99.8%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6490.2
Applied rewrites90.2%
if -3.1999999999999999e100 < x < 4.0000000000000004e44Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6495.8
Applied rewrites95.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (- (* (log y) x) z))) (if (<= x -1.95e+21) t_1 (if (<= x 1.2e+77) (- (- (log t) y) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (log(y) * x) - z;
double tmp;
if (x <= -1.95e+21) {
tmp = t_1;
} else if (x <= 1.2e+77) {
tmp = (log(t) - y) - 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 = (log(y) * x) - z
if (x <= (-1.95d+21)) then
tmp = t_1
else if (x <= 1.2d+77) then
tmp = (log(t) - y) - 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 = (Math.log(y) * x) - z;
double tmp;
if (x <= -1.95e+21) {
tmp = t_1;
} else if (x <= 1.2e+77) {
tmp = (Math.log(t) - y) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (math.log(y) * x) - z tmp = 0 if x <= -1.95e+21: tmp = t_1 elif x <= 1.2e+77: tmp = (math.log(t) - y) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(log(y) * x) - z) tmp = 0.0 if (x <= -1.95e+21) tmp = t_1; elseif (x <= 1.2e+77) tmp = Float64(Float64(log(t) - y) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (log(y) * x) - z; tmp = 0.0; if (x <= -1.95e+21) tmp = t_1; elseif (x <= 1.2e+77) tmp = (log(t) - y) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -1.95e+21], t$95$1, If[LessEqual[x, 1.2e+77], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x - z\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+77}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.95e21 or 1.1999999999999999e77 < x Initial program 99.8%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6481.8
Applied rewrites81.8%
Taylor expanded in x around inf
Applied rewrites81.8%
if -1.95e21 < x < 1.1999999999999999e77Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6497.0
Applied rewrites97.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (log y) x))) (if (<= x -1.1e+104) t_1 (if (<= x 9.5e+138) (- (- (log t) y) z) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -1.1e+104) {
tmp = t_1;
} else if (x <= 9.5e+138) {
tmp = (log(t) - y) - 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 = log(y) * x
if (x <= (-1.1d+104)) then
tmp = t_1
else if (x <= 9.5d+138) then
tmp = (log(t) - y) - 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 = Math.log(y) * x;
double tmp;
if (x <= -1.1e+104) {
tmp = t_1;
} else if (x <= 9.5e+138) {
tmp = (Math.log(t) - y) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -1.1e+104: tmp = t_1 elif x <= 9.5e+138: tmp = (math.log(t) - y) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -1.1e+104) tmp = t_1; elseif (x <= 9.5e+138) tmp = Float64(Float64(log(t) - y) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; tmp = 0.0; if (x <= -1.1e+104) tmp = t_1; elseif (x <= 9.5e+138) tmp = (log(t) - y) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -1.1e+104], t$95$1, If[LessEqual[x, 9.5e+138], N[(N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+138}:\\
\;\;\;\;\left(\log t - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.1e104 or 9.49999999999999998e138 < x Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6473.0
Applied rewrites73.0%
if -1.1e104 < x < 9.49999999999999998e138Initial program 100.0%
Taylor expanded in x around 0
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lower-log.f6492.5
Applied rewrites92.5%
(FPCore (x y z t) :precision binary64 (if (<= y 1.05e+47) (- (log t) z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.05e+47) {
tmp = log(t) - 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 <= 1.05d+47) then
tmp = log(t) - 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 <= 1.05e+47) {
tmp = Math.log(t) - z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.05e+47: tmp = math.log(t) - z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.05e+47) tmp = Float64(log(t) - z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.05e+47) tmp = log(t) - z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.05e+47], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.05 \cdot 10^{+47}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.05e47Initial program 99.9%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-log.f6496.5
Applied rewrites96.5%
Taylor expanded in x around 0
Applied rewrites62.7%
if 1.05e47 < y Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6462.7
Applied rewrites62.7%
(FPCore (x y z t) :precision binary64 (if (<= y 1e+47) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1e+47) {
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 <= 1d+47) 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 <= 1e+47) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1e+47: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1e+47) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1e+47) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1e+47], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+47}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1e47Initial program 99.9%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6441.2
Applied rewrites41.2%
if 1e47 < y Initial program 99.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6462.7
Applied rewrites62.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 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.9%
Taylor expanded in y around inf
mul-1-negN/A
lower-neg.f6430.0
Applied rewrites30.0%
herbie shell --seed 2024249
(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)))