
(FPCore (x y z t) :precision binary64 (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
return x - (log(((1.0 - y) + (y * exp(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 = x - (log(((1.0d0 - y) + (y * exp(z)))) / t)
end function
public static double code(double x, double y, double z, double t) {
return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
def code(x, y, z, t): return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
function code(x, y, z, t) return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t)) end
function tmp = code(x, y, z, t) tmp = x - (log(((1.0 - y) + (y * exp(z)))) / t); end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))
double code(double x, double y, double z, double t) {
return x - (log(((1.0 - y) + (y * exp(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 = x - (log(((1.0d0 - y) + (y * exp(z)))) / t)
end function
public static double code(double x, double y, double z, double t) {
return x - (Math.log(((1.0 - y) + (y * Math.exp(z)))) / t);
}
def code(x, y, z, t): return x - (math.log(((1.0 - y) + (y * math.exp(z)))) / t)
function code(x, y, z, t) return Float64(x - Float64(log(Float64(Float64(1.0 - y) + Float64(y * exp(z)))) / t)) end
function tmp = code(x, y, z, t) tmp = x - (log(((1.0 - y) + (y * exp(z)))) / t); end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{\log \left(\left(1 - y\right) + y \cdot e^{z}\right)}{t}
\end{array}
(FPCore (x y z t) :precision binary64 (- x (/ (log1p (* y (expm1 z))) t)))
double code(double x, double y, double z, double t) {
return x - (log1p((y * expm1(z))) / t);
}
public static double code(double x, double y, double z, double t) {
return x - (Math.log1p((y * Math.expm1(z))) / t);
}
def code(x, y, z, t): return x - (math.log1p((y * math.expm1(z))) / t)
function code(x, y, z, t) return Float64(x - Float64(log1p(Float64(y * expm1(z))) / t)) end
code[x_, y_, z_, t_] := N[(x - N[(N[Log[1 + N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{t}
\end{array}
Initial program 60.9%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.6
Simplified99.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- 1.0 y) (* y (exp z)))))
(if (<= t_1 0.0)
(- x (/ (log1p (* y z)) t))
(if (<= t_1 50000000.0)
(fma (/ (expm1 z) t) (- y) x)
(if (<= t_1 1e+117)
(/ (log1p (* y (expm1 z))) (- t))
(fma
(/ 1.0 (/ (fma t (/ x (expm1 z)) (* 0.5 (* y (* x t)))) y))
(- x)
x))))))
double code(double x, double y, double z, double t) {
double t_1 = (1.0 - y) + (y * exp(z));
double tmp;
if (t_1 <= 0.0) {
tmp = x - (log1p((y * z)) / t);
} else if (t_1 <= 50000000.0) {
tmp = fma((expm1(z) / t), -y, x);
} else if (t_1 <= 1e+117) {
tmp = log1p((y * expm1(z))) / -t;
} else {
tmp = fma((1.0 / (fma(t, (x / expm1(z)), (0.5 * (y * (x * t)))) / y)), -x, x);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(1.0 - y) + Float64(y * exp(z))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(x - Float64(log1p(Float64(y * z)) / t)); elseif (t_1 <= 50000000.0) tmp = fma(Float64(expm1(z) / t), Float64(-y), x); elseif (t_1 <= 1e+117) tmp = Float64(log1p(Float64(y * expm1(z))) / Float64(-t)); else tmp = fma(Float64(1.0 / Float64(fma(t, Float64(x / expm1(z)), Float64(0.5 * Float64(y * Float64(x * t)))) / y)), Float64(-x), x); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(x - N[(N[Log[1 + N[(y * z), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 50000000.0], N[(N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision] * (-y) + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+117], N[(N[Log[1 + N[(y * N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t)), $MachinePrecision], N[(N[(1.0 / N[(N[(t * N[(x / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] * (-x) + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) + y \cdot e^{z}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot z\right)}{t}\\
\mathbf{elif}\;t\_1 \leq 50000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{t}, -y, x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+117}:\\
\;\;\;\;\frac{\mathsf{log1p}\left(y \cdot \mathsf{expm1}\left(z\right)\right)}{-t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\mathsf{expm1}\left(z\right)}, 0.5 \cdot \left(y \cdot \left(x \cdot t\right)\right)\right)}{y}}, -x, x\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 0.0Initial program 2.3%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.9
Simplified99.9%
Taylor expanded in z around 0
*-lowering-*.f6499.9
Simplified99.9%
if 0.0 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 5e7Initial program 78.1%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.3
Simplified99.3%
Taylor expanded in y around 0
associate-/l*N/A
div-subN/A
*-lowering-*.f64N/A
div-subN/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f6499.4
Simplified99.4%
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f64N/A
neg-lowering-neg.f6499.4
Applied egg-rr99.4%
if 5e7 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 1.00000000000000005e117Initial program 97.7%
Taylor expanded in x around 0
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f64N/A
neg-lowering-neg.f6476.4
Simplified76.4%
if 1.00000000000000005e117 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) Initial program 99.3%
Taylor expanded in x around inf
*-commutativeN/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified92.4%
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6492.4
Applied egg-rr92.4%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6468.5
Simplified68.5%
Final simplification95.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- 1.0 y) (* y (exp z)))))
(if (<= t_1 0.0)
(- x (/ (log1p (* y z)) t))
(if (<= t_1 2.0)
(fma (/ (expm1 z) t) (- y) x)
(fma
(/ 1.0 (/ (fma t (/ x (expm1 z)) (* 0.5 (* y (* x t)))) y))
(- x)
x)))))
double code(double x, double y, double z, double t) {
double t_1 = (1.0 - y) + (y * exp(z));
double tmp;
if (t_1 <= 0.0) {
tmp = x - (log1p((y * z)) / t);
} else if (t_1 <= 2.0) {
tmp = fma((expm1(z) / t), -y, x);
} else {
tmp = fma((1.0 / (fma(t, (x / expm1(z)), (0.5 * (y * (x * t)))) / y)), -x, x);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(1.0 - y) + Float64(y * exp(z))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(x - Float64(log1p(Float64(y * z)) / t)); elseif (t_1 <= 2.0) tmp = fma(Float64(expm1(z) / t), Float64(-y), x); else tmp = fma(Float64(1.0 / Float64(fma(t, Float64(x / expm1(z)), Float64(0.5 * Float64(y * Float64(x * t)))) / y)), Float64(-x), x); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(x - N[(N[Log[1 + N[(y * z), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2.0], N[(N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision] * (-y) + x), $MachinePrecision], N[(N[(1.0 / N[(N[(t * N[(x / N[(Exp[z] - 1), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] * (-x) + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) + y \cdot e^{z}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot z\right)}{t}\\
\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{t}, -y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{\mathsf{fma}\left(t, \frac{x}{\mathsf{expm1}\left(z\right)}, 0.5 \cdot \left(y \cdot \left(x \cdot t\right)\right)\right)}{y}}, -x, x\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 0.0Initial program 2.3%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.9
Simplified99.9%
Taylor expanded in z around 0
*-lowering-*.f6499.9
Simplified99.9%
if 0.0 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 2Initial program 77.7%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.3
Simplified99.3%
Taylor expanded in y around 0
associate-/l*N/A
div-subN/A
*-lowering-*.f64N/A
div-subN/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f6499.9
Simplified99.9%
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f64N/A
neg-lowering-neg.f6499.9
Applied egg-rr99.9%
if 2 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) Initial program 98.7%
Taylor expanded in x around inf
*-commutativeN/A
+-commutativeN/A
distribute-lft1-inN/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified86.9%
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6487.0
Applied egg-rr87.0%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6455.2
Simplified55.2%
Final simplification92.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- 1.0 y) (* y (exp z)))))
(if (<= t_1 0.0)
(- x (/ (log1p (* y z)) t))
(if (<= t_1 1e+63) (fma (/ (expm1 z) t) (- y) x) x))))
double code(double x, double y, double z, double t) {
double t_1 = (1.0 - y) + (y * exp(z));
double tmp;
if (t_1 <= 0.0) {
tmp = x - (log1p((y * z)) / t);
} else if (t_1 <= 1e+63) {
tmp = fma((expm1(z) / t), -y, x);
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(1.0 - y) + Float64(y * exp(z))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(x - Float64(log1p(Float64(y * z)) / t)); elseif (t_1 <= 1e+63) tmp = fma(Float64(expm1(z) / t), Float64(-y), x); else tmp = x; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(x - N[(N[Log[1 + N[(y * z), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision] * (-y) + x), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) + y \cdot e^{z}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot z\right)}{t}\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{expm1}\left(z\right)}{t}, -y, x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 0.0Initial program 2.3%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.9
Simplified99.9%
Taylor expanded in z around 0
*-lowering-*.f6499.9
Simplified99.9%
if 0.0 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 1.00000000000000006e63Initial program 79.3%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.4
Simplified99.4%
Taylor expanded in y around 0
associate-/l*N/A
div-subN/A
*-lowering-*.f64N/A
div-subN/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f6495.3
Simplified95.3%
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f64N/A
neg-lowering-neg.f6495.3
Applied egg-rr95.3%
if 1.00000000000000006e63 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) Initial program 98.3%
Taylor expanded in x around inf
Simplified56.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- 1.0 y) (* y (exp z)))))
(if (<= t_1 0.0)
(- x (/ (log1p (* y z)) t))
(if (<= t_1 1e+63) (- x (* y (/ (expm1 z) t))) x))))
double code(double x, double y, double z, double t) {
double t_1 = (1.0 - y) + (y * exp(z));
double tmp;
if (t_1 <= 0.0) {
tmp = x - (log1p((y * z)) / t);
} else if (t_1 <= 1e+63) {
tmp = x - (y * (expm1(z) / t));
} else {
tmp = x;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (1.0 - y) + (y * Math.exp(z));
double tmp;
if (t_1 <= 0.0) {
tmp = x - (Math.log1p((y * z)) / t);
} else if (t_1 <= 1e+63) {
tmp = x - (y * (Math.expm1(z) / t));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (1.0 - y) + (y * math.exp(z)) tmp = 0 if t_1 <= 0.0: tmp = x - (math.log1p((y * z)) / t) elif t_1 <= 1e+63: tmp = x - (y * (math.expm1(z) / t)) else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(1.0 - y) + Float64(y * exp(z))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(x - Float64(log1p(Float64(y * z)) / t)); elseif (t_1 <= 1e+63) tmp = Float64(x - Float64(y * Float64(expm1(z) / t))); else tmp = x; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(x - N[(N[Log[1 + N[(y * z), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(x - N[(y * N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) + y \cdot e^{z}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;x - \frac{\mathsf{log1p}\left(y \cdot z\right)}{t}\\
\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;x - y \cdot \frac{\mathsf{expm1}\left(z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 0.0Initial program 2.3%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.9
Simplified99.9%
Taylor expanded in z around 0
*-lowering-*.f6499.9
Simplified99.9%
if 0.0 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 1.00000000000000006e63Initial program 79.3%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.4
Simplified99.4%
Taylor expanded in y around 0
associate-/l*N/A
div-subN/A
*-lowering-*.f64N/A
div-subN/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f6495.3
Simplified95.3%
if 1.00000000000000006e63 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) Initial program 98.3%
Taylor expanded in x around inf
Simplified56.2%
(FPCore (x y z t) :precision binary64 (if (<= (+ (- 1.0 y) (* y (exp z))) 1e+63) (- x (* y (/ (expm1 z) t))) x))
double code(double x, double y, double z, double t) {
double tmp;
if (((1.0 - y) + (y * exp(z))) <= 1e+63) {
tmp = x - (y * (expm1(z) / t));
} else {
tmp = x;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if (((1.0 - y) + (y * Math.exp(z))) <= 1e+63) {
tmp = x - (y * (Math.expm1(z) / t));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((1.0 - y) + (y * math.exp(z))) <= 1e+63: tmp = x - (y * (math.expm1(z) / t)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(1.0 - y) + Float64(y * exp(z))) <= 1e+63) tmp = Float64(x - Float64(y * Float64(expm1(z) / t))); else tmp = x; end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(1.0 - y), $MachinePrecision] + N[(y * N[Exp[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+63], N[(x - N[(y * N[(N[(Exp[z] - 1), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(1 - y\right) + y \cdot e^{z} \leq 10^{+63}:\\
\;\;\;\;x - y \cdot \frac{\mathsf{expm1}\left(z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) < 1.00000000000000006e63Initial program 55.6%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.5
Simplified99.5%
Taylor expanded in y around 0
associate-/l*N/A
div-subN/A
*-lowering-*.f64N/A
div-subN/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f6489.6
Simplified89.6%
if 1.00000000000000006e63 < (+.f64 (-.f64 #s(literal 1 binary64) y) (*.f64 y (exp.f64 z))) Initial program 98.3%
Taylor expanded in x around inf
Simplified56.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.65e-69)
x
(-
x
(*
y
(/
(fma
(* z z)
(fma z (fma z 0.041666666666666664 0.16666666666666666) 0.5)
z)
t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.65e-69) {
tmp = x;
} else {
tmp = x - (y * (fma((z * z), fma(z, fma(z, 0.041666666666666664, 0.16666666666666666), 0.5), z) / t));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -1.65e-69) tmp = x; else tmp = Float64(x - Float64(y * Float64(fma(Float64(z * z), fma(z, fma(z, 0.041666666666666664, 0.16666666666666666), 0.5), z) / t))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.65e-69], x, N[(x - N[(y * N[(N[(N[(z * z), $MachinePrecision] * N[(z * N[(z * 0.041666666666666664 + 0.16666666666666666), $MachinePrecision] + 0.5), $MachinePrecision] + z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-69}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{\mathsf{fma}\left(z \cdot z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), z\right)}{t}\\
\end{array}
\end{array}
if z < -1.65e-69Initial program 77.6%
Taylor expanded in x around inf
Simplified61.1%
if -1.65e-69 < z Initial program 48.9%
Taylor expanded in z around inf
sub-negN/A
associate-+l+N/A
*-rgt-identityN/A
cancel-sign-sub-invN/A
distribute-lft-out--N/A
accelerator-lowering-log1p.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-expm1.f6499.4
Simplified99.4%
Taylor expanded in y around 0
associate-/l*N/A
div-subN/A
*-lowering-*.f64N/A
div-subN/A
/-lowering-/.f64N/A
accelerator-lowering-expm1.f6492.4
Simplified92.4%
Taylor expanded in z around 0
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
unpow2N/A
*-rgt-identityN/A
accelerator-lowering-fma.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6491.8
Simplified91.8%
(FPCore (x y z t) :precision binary64 (if (<= z -1.11e-69) x (fma y (/ (fma z (* z (fma z 0.16666666666666666 0.5)) z) (- t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.11e-69) {
tmp = x;
} else {
tmp = fma(y, (fma(z, (z * fma(z, 0.16666666666666666, 0.5)), z) / -t), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -1.11e-69) tmp = x; else tmp = fma(y, Float64(fma(z, Float64(z * fma(z, 0.16666666666666666, 0.5)), z) / Float64(-t)), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.11e-69], x, N[(y * N[(N[(z * N[(z * N[(z * 0.16666666666666666 + 0.5), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] / (-t)), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.11 \cdot 10^{-69}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, z \cdot \mathsf{fma}\left(z, 0.16666666666666666, 0.5\right), z\right)}{-t}, x\right)\\
\end{array}
\end{array}
if z < -1.10999999999999999e-69Initial program 77.6%
Taylor expanded in x around inf
Simplified61.1%
if -1.10999999999999999e-69 < z Initial program 48.9%
Taylor expanded in z around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified69.1%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
accelerator-lowering-fma.f64N/A
Simplified91.8%
(FPCore (x y z t) :precision binary64 (if (<= z -1.65e-69) x (fma y (/ (* z (fma z -0.5 -1.0)) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.65e-69) {
tmp = x;
} else {
tmp = fma(y, ((z * fma(z, -0.5, -1.0)) / t), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -1.65e-69) tmp = x; else tmp = fma(y, Float64(Float64(z * fma(z, -0.5, -1.0)) / t), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.65e-69], x, N[(y * N[(N[(z * N[(z * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-69}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z \cdot \mathsf{fma}\left(z, -0.5, -1\right)}{t}, x\right)\\
\end{array}
\end{array}
if z < -1.65e-69Initial program 77.6%
Taylor expanded in x around inf
Simplified61.1%
if -1.65e-69 < z Initial program 48.9%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f6475.6
Simplified75.6%
Taylor expanded in z around 0
associate-*r/N/A
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6491.8
Simplified91.8%
(FPCore (x y z t) :precision binary64 (if (<= x -2.4e-260) x (if (<= x 8.2e-167) (/ (* y z) (- t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.4e-260) {
tmp = x;
} else if (x <= 8.2e-167) {
tmp = (y * z) / -t;
} else {
tmp = x;
}
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.4d-260)) then
tmp = x
else if (x <= 8.2d-167) then
tmp = (y * z) / -t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.4e-260) {
tmp = x;
} else if (x <= 8.2e-167) {
tmp = (y * z) / -t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.4e-260: tmp = x elif x <= 8.2e-167: tmp = (y * z) / -t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.4e-260) tmp = x; elseif (x <= 8.2e-167) tmp = Float64(Float64(y * z) / Float64(-t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.4e-260) tmp = x; elseif (x <= 8.2e-167) tmp = (y * z) / -t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.4e-260], x, If[LessEqual[x, 8.2e-167], N[(N[(y * z), $MachinePrecision] / (-t)), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-260}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-167}:\\
\;\;\;\;\frac{y \cdot z}{-t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.4000000000000001e-260 or 8.20000000000000036e-167 < x Initial program 68.2%
Taylor expanded in x around inf
Simplified78.4%
if -2.4000000000000001e-260 < x < 8.20000000000000036e-167Initial program 16.2%
Taylor expanded in z around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified42.2%
Taylor expanded in z around 0
Simplified55.1%
Taylor expanded in x around 0
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6447.4
Simplified47.4%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-lowering-neg.f6448.7
Simplified48.7%
Final simplification74.2%
(FPCore (x y z t) :precision binary64 (if (<= x -1.02e-262) x (if (<= x 3.2e-167) (- (* z (/ y t))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.02e-262) {
tmp = x;
} else if (x <= 3.2e-167) {
tmp = -(z * (y / t));
} else {
tmp = x;
}
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.02d-262)) then
tmp = x
else if (x <= 3.2d-167) then
tmp = -(z * (y / t))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.02e-262) {
tmp = x;
} else if (x <= 3.2e-167) {
tmp = -(z * (y / t));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.02e-262: tmp = x elif x <= 3.2e-167: tmp = -(z * (y / t)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.02e-262) tmp = x; elseif (x <= 3.2e-167) tmp = Float64(-Float64(z * Float64(y / t))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.02e-262) tmp = x; elseif (x <= 3.2e-167) tmp = -(z * (y / t)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.02e-262], x, If[LessEqual[x, 3.2e-167], (-N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{-262}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-167}:\\
\;\;\;\;-z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.01999999999999994e-262 or 3.2000000000000002e-167 < x Initial program 68.2%
Taylor expanded in x around inf
Simplified78.4%
if -1.01999999999999994e-262 < x < 3.2000000000000002e-167Initial program 16.2%
Taylor expanded in z around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified42.2%
Taylor expanded in z around 0
Simplified55.1%
Taylor expanded in x around 0
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6447.4
Simplified47.4%
Final simplification74.1%
(FPCore (x y z t) :precision binary64 (if (<= x -3.1e-269) x (if (<= x 3.5e-167) (- (* y (/ z t))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.1e-269) {
tmp = x;
} else if (x <= 3.5e-167) {
tmp = -(y * (z / t));
} else {
tmp = x;
}
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.1d-269)) then
tmp = x
else if (x <= 3.5d-167) then
tmp = -(y * (z / t))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.1e-269) {
tmp = x;
} else if (x <= 3.5e-167) {
tmp = -(y * (z / t));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.1e-269: tmp = x elif x <= 3.5e-167: tmp = -(y * (z / t)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.1e-269) tmp = x; elseif (x <= 3.5e-167) tmp = Float64(-Float64(y * Float64(z / t))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.1e-269) tmp = x; elseif (x <= 3.5e-167) tmp = -(y * (z / t)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.1e-269], x, If[LessEqual[x, 3.5e-167], (-N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-269}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-167}:\\
\;\;\;\;-y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.09999999999999967e-269 or 3.4999999999999999e-167 < x Initial program 67.4%
Taylor expanded in x around inf
Simplified77.4%
if -3.09999999999999967e-269 < x < 3.4999999999999999e-167Initial program 17.4%
Taylor expanded in z around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified45.7%
Taylor expanded in z around 0
Simplified58.1%
Taylor expanded in x around 0
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6449.7
Simplified49.7%
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
neg-lowering-neg.f6450.8
Applied egg-rr50.8%
Final simplification74.0%
(FPCore (x y z t) :precision binary64 (if (<= z -1.65e-69) x (fma y (- (/ z t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.65e-69) {
tmp = x;
} else {
tmp = fma(y, -(z / t), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -1.65e-69) tmp = x; else tmp = fma(y, Float64(-Float64(z / t)), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.65e-69], x, N[(y * (-N[(z / t), $MachinePrecision]) + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-69}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, -\frac{z}{t}, x\right)\\
\end{array}
\end{array}
if z < -1.65e-69Initial program 77.6%
Taylor expanded in x around inf
Simplified61.1%
if -1.65e-69 < z Initial program 48.9%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f6475.6
Simplified75.6%
Taylor expanded in z around 0
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f6491.7
Simplified91.7%
(FPCore (x y z t) :precision binary64 (if (<= z -1.62e-69) x (- x (/ (* y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.62e-69) {
tmp = x;
} else {
tmp = x - ((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 (z <= (-1.62d-69)) then
tmp = x
else
tmp = x - ((y * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.62e-69) {
tmp = x;
} else {
tmp = x - ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.62e-69: tmp = x else: tmp = x - ((y * z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.62e-69) tmp = x; else tmp = Float64(x - Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.62e-69) tmp = x; else tmp = x - ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.62e-69], x, N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.62 \cdot 10^{-69}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.62e-69Initial program 77.6%
Taylor expanded in x around inf
Simplified61.1%
if -1.62e-69 < z Initial program 48.9%
Taylor expanded in z around 0
*-lowering-*.f6491.4
Simplified91.4%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 60.9%
Taylor expanded in x around inf
Simplified69.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- 0.5) (* y t))))
(if (< z -2.8874623088207947e+119)
(- (- x (/ t_1 (* z z))) (* t_1 (/ (/ 2.0 z) (* z z))))
(- x (/ (log (+ 1.0 (* z y))) t)))))
double code(double x, double y, double z, double t) {
double t_1 = -0.5 / (y * t);
double tmp;
if (z < -2.8874623088207947e+119) {
tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
} else {
tmp = x - (log((1.0 + (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) :: t_1
real(8) :: tmp
t_1 = -0.5d0 / (y * t)
if (z < (-2.8874623088207947d+119)) then
tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0d0 / z) / (z * z)))
else
tmp = x - (log((1.0d0 + (z * y))) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -0.5 / (y * t);
double tmp;
if (z < -2.8874623088207947e+119) {
tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z)));
} else {
tmp = x - (Math.log((1.0 + (z * y))) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = -0.5 / (y * t) tmp = 0 if z < -2.8874623088207947e+119: tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z))) else: tmp = x - (math.log((1.0 + (z * y))) / t) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-0.5) / Float64(y * t)) tmp = 0.0 if (z < -2.8874623088207947e+119) tmp = Float64(Float64(x - Float64(t_1 / Float64(z * z))) - Float64(t_1 * Float64(Float64(2.0 / z) / Float64(z * z)))); else tmp = Float64(x - Float64(log(Float64(1.0 + Float64(z * y))) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -0.5 / (y * t); tmp = 0.0; if (z < -2.8874623088207947e+119) tmp = (x - (t_1 / (z * z))) - (t_1 * ((2.0 / z) / (z * z))); else tmp = x - (log((1.0 + (z * y))) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-0.5) / N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -2.8874623088207947e+119], N[(N[(x - N[(t$95$1 / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(N[(2.0 / z), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[N[(1.0 + N[(z * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-0.5}{y \cdot t}\\
\mathbf{if}\;z < -2.8874623088207947 \cdot 10^{+119}:\\
\;\;\;\;\left(x - \frac{t\_1}{z \cdot z}\right) - t\_1 \cdot \frac{\frac{2}{z}}{z \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{\log \left(1 + z \cdot y\right)}{t}\\
\end{array}
\end{array}
herbie shell --seed 2024198
(FPCore (x y z t)
:name "System.Random.MWC.Distributions:truncatedExp from mwc-random-0.13.3.2"
:precision binary64
:alt
(! :herbie-platform default (if (< z -288746230882079470000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (- x (/ (/ (- 1/2) (* y t)) (* z z))) (* (/ (- 1/2) (* y t)) (/ (/ 2 z) (* z z)))) (- x (/ (log (+ 1 (* z y))) t))))
(- x (/ (log (+ (- 1.0 y) (* y (exp z)))) t)))