
(FPCore (x y z) :precision binary64 (exp (- (+ x (* y (log y))) z)))
double code(double x, double y, double z) {
return exp(((x + (y * log(y))) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = exp(((x + (y * log(y))) - z))
end function
public static double code(double x, double y, double z) {
return Math.exp(((x + (y * Math.log(y))) - z));
}
def code(x, y, z): return math.exp(((x + (y * math.log(y))) - z))
function code(x, y, z) return exp(Float64(Float64(x + Float64(y * log(y))) - z)) end
function tmp = code(x, y, z) tmp = exp(((x + (y * log(y))) - z)); end
code[x_, y_, z_] := N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(x + y \cdot \log y\right) - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (exp (- (+ x (* y (log y))) z)))
double code(double x, double y, double z) {
return exp(((x + (y * log(y))) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = exp(((x + (y * log(y))) - z))
end function
public static double code(double x, double y, double z) {
return Math.exp(((x + (y * Math.log(y))) - z));
}
def code(x, y, z): return math.exp(((x + (y * math.log(y))) - z))
function code(x, y, z) return exp(Float64(Float64(x + Float64(y * log(y))) - z)) end
function tmp = code(x, y, z) tmp = exp(((x + (y * log(y))) - z)); end
code[x_, y_, z_] := N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(x + y \cdot \log y\right) - z}
\end{array}
(FPCore (x y z) :precision binary64 (exp (- (+ x (* y (log y))) z)))
double code(double x, double y, double z) {
return exp(((x + (y * log(y))) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = exp(((x + (y * log(y))) - z))
end function
public static double code(double x, double y, double z) {
return Math.exp(((x + (y * Math.log(y))) - z));
}
def code(x, y, z): return math.exp(((x + (y * math.log(y))) - z))
function code(x, y, z) return exp(Float64(Float64(x + Float64(y * log(y))) - z)) end
function tmp = code(x, y, z) tmp = exp(((x + (y * log(y))) - z)); end
code[x_, y_, z_] := N[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(x + y \cdot \log y\right) - z}
\end{array}
Initial program 100.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (* y (log y))))) (if (<= t_0 -1000.0) (exp x) (if (<= t_0 5e+115) (exp (- z)) (pow y y)))))
double code(double x, double y, double z) {
double t_0 = x + (y * log(y));
double tmp;
if (t_0 <= -1000.0) {
tmp = exp(x);
} else if (t_0 <= 5e+115) {
tmp = exp(-z);
} else {
tmp = pow(y, y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x + (y * log(y))
if (t_0 <= (-1000.0d0)) then
tmp = exp(x)
else if (t_0 <= 5d+115) then
tmp = exp(-z)
else
tmp = y ** y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y * Math.log(y));
double tmp;
if (t_0 <= -1000.0) {
tmp = Math.exp(x);
} else if (t_0 <= 5e+115) {
tmp = Math.exp(-z);
} else {
tmp = Math.pow(y, y);
}
return tmp;
}
def code(x, y, z): t_0 = x + (y * math.log(y)) tmp = 0 if t_0 <= -1000.0: tmp = math.exp(x) elif t_0 <= 5e+115: tmp = math.exp(-z) else: tmp = math.pow(y, y) return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y * log(y))) tmp = 0.0 if (t_0 <= -1000.0) tmp = exp(x); elseif (t_0 <= 5e+115) tmp = exp(Float64(-z)); else tmp = y ^ y; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y * log(y)); tmp = 0.0; if (t_0 <= -1000.0) tmp = exp(x); elseif (t_0 <= 5e+115) tmp = exp(-z); else tmp = y ^ y; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1000.0], N[Exp[x], $MachinePrecision], If[LessEqual[t$95$0, 5e+115], N[Exp[(-z)], $MachinePrecision], N[Power[y, y], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot \log y\\
\mathbf{if}\;t\_0 \leq -1000:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+115}:\\
\;\;\;\;e^{-z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 y (log.f64 y))) < -1e3Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f64100.0
Simplified100.0%
Taylor expanded in z around 0
lower-exp.f6495.3
Simplified95.3%
if -1e3 < (+.f64 x (*.f64 y (log.f64 y))) < 5.00000000000000008e115Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6480.2
Simplified80.2%
if 5.00000000000000008e115 < (+.f64 x (*.f64 y (log.f64 y))) Initial program 100.0%
Taylor expanded in y around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower-log.f6469.9
Simplified69.9%
lift-log.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-pow.f6469.9
Applied egg-rr69.9%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- (+ x (* y (log y))) z)) (t_1 (* (* z z) 0.5))) (if (<= t_0 -1000.0) t_1 (if (<= t_0 1e+113) (+ x 1.0) t_1))))
double code(double x, double y, double z) {
double t_0 = (x + (y * log(y))) - z;
double t_1 = (z * z) * 0.5;
double tmp;
if (t_0 <= -1000.0) {
tmp = t_1;
} else if (t_0 <= 1e+113) {
tmp = x + 1.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x + (y * log(y))) - z
t_1 = (z * z) * 0.5d0
if (t_0 <= (-1000.0d0)) then
tmp = t_1
else if (t_0 <= 1d+113) then
tmp = x + 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x + (y * Math.log(y))) - z;
double t_1 = (z * z) * 0.5;
double tmp;
if (t_0 <= -1000.0) {
tmp = t_1;
} else if (t_0 <= 1e+113) {
tmp = x + 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = (x + (y * math.log(y))) - z t_1 = (z * z) * 0.5 tmp = 0 if t_0 <= -1000.0: tmp = t_1 elif t_0 <= 1e+113: tmp = x + 1.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(Float64(x + Float64(y * log(y))) - z) t_1 = Float64(Float64(z * z) * 0.5) tmp = 0.0 if (t_0 <= -1000.0) tmp = t_1; elseif (t_0 <= 1e+113) tmp = Float64(x + 1.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x + (y * log(y))) - z; t_1 = (z * z) * 0.5; tmp = 0.0; if (t_0 <= -1000.0) tmp = t_1; elseif (t_0 <= 1e+113) tmp = x + 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[t$95$0, -1000.0], t$95$1, If[LessEqual[t$95$0, 1e+113], N[(x + 1.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(x + y \cdot \log y\right) - z\\
t_1 := \left(z \cdot z\right) \cdot 0.5\\
\mathbf{if}\;t\_0 \leq -1000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+113}:\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < -1e3 or 1e113 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6449.8
Simplified49.8%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6425.8
Simplified25.8%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f6430.6
Simplified30.6%
if -1e3 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < 1e113Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f6481.5
Simplified81.5%
Taylor expanded in z around 0
lower-exp.f6470.3
Simplified70.3%
Taylor expanded in x around 0
lower-+.f6448.7
Simplified48.7%
Final simplification34.7%
(FPCore (x y z) :precision binary64 (if (<= (* y (log y)) 2e+160) (exp (- x z)) (pow y y)))
double code(double x, double y, double z) {
double tmp;
if ((y * log(y)) <= 2e+160) {
tmp = exp((x - z));
} else {
tmp = pow(y, y);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y * log(y)) <= 2d+160) then
tmp = exp((x - z))
else
tmp = y ** y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y * Math.log(y)) <= 2e+160) {
tmp = Math.exp((x - z));
} else {
tmp = Math.pow(y, y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y * math.log(y)) <= 2e+160: tmp = math.exp((x - z)) else: tmp = math.pow(y, y) return tmp
function code(x, y, z) tmp = 0.0 if (Float64(y * log(y)) <= 2e+160) tmp = exp(Float64(x - z)); else tmp = y ^ y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y * log(y)) <= 2e+160) tmp = exp((x - z)); else tmp = y ^ y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision], 2e+160], N[Exp[N[(x - z), $MachinePrecision]], $MachinePrecision], N[Power[y, y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot \log y \leq 2 \cdot 10^{+160}:\\
\;\;\;\;e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if (*.f64 y (log.f64 y)) < 2.00000000000000001e160Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f6491.8
Simplified91.8%
if 2.00000000000000001e160 < (*.f64 y (log.f64 y)) Initial program 100.0%
Taylor expanded in y around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower-log.f6490.9
Simplified90.9%
lift-log.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-pow.f6490.9
Applied egg-rr90.9%
(FPCore (x y z) :precision binary64 (if (<= (- (+ x (* y (log y))) z) -500.0) (* (* z z) 0.5) (fma z (* z 0.5) 1.0)))
double code(double x, double y, double z) {
double tmp;
if (((x + (y * log(y))) - z) <= -500.0) {
tmp = (z * z) * 0.5;
} else {
tmp = fma(z, (z * 0.5), 1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(x + Float64(y * log(y))) - z) <= -500.0) tmp = Float64(Float64(z * z) * 0.5); else tmp = fma(z, Float64(z * 0.5), 1.0); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], -500.0], N[(N[(z * z), $MachinePrecision] * 0.5), $MachinePrecision], N[(z * N[(z * 0.5), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(x + y \cdot \log y\right) - z \leq -500:\\
\;\;\;\;\left(z \cdot z\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, z \cdot 0.5, 1\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < -500Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6456.1
Simplified56.1%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f642.2
Simplified2.2%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f6416.2
Simplified16.2%
if -500 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6452.0
Simplified52.0%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6442.1
Simplified42.1%
Taylor expanded in z around inf
lower-*.f6442.0
Simplified42.0%
Final simplification34.8%
(FPCore (x y z) :precision binary64 (if (<= x -7.6e+65) (exp x) (if (<= x 86.0) (pow y y) (exp x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -7.6e+65) {
tmp = exp(x);
} else if (x <= 86.0) {
tmp = pow(y, y);
} else {
tmp = exp(x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-7.6d+65)) then
tmp = exp(x)
else if (x <= 86.0d0) then
tmp = y ** y
else
tmp = exp(x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -7.6e+65) {
tmp = Math.exp(x);
} else if (x <= 86.0) {
tmp = Math.pow(y, y);
} else {
tmp = Math.exp(x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -7.6e+65: tmp = math.exp(x) elif x <= 86.0: tmp = math.pow(y, y) else: tmp = math.exp(x) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -7.6e+65) tmp = exp(x); elseif (x <= 86.0) tmp = y ^ y; else tmp = exp(x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -7.6e+65) tmp = exp(x); elseif (x <= 86.0) tmp = y ^ y; else tmp = exp(x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -7.6e+65], N[Exp[x], $MachinePrecision], If[LessEqual[x, 86.0], N[Power[y, y], $MachinePrecision], N[Exp[x], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{+65}:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;x \leq 86:\\
\;\;\;\;{y}^{y}\\
\mathbf{else}:\\
\;\;\;\;e^{x}\\
\end{array}
\end{array}
if x < -7.60000000000000022e65 or 86 < x Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f6494.4
Simplified94.4%
Taylor expanded in z around 0
lower-exp.f6486.4
Simplified86.4%
if -7.60000000000000022e65 < x < 86Initial program 100.0%
Taylor expanded in y around inf
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
lower-*.f64N/A
lower-log.f6468.6
Simplified68.6%
lift-log.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-pow.f6468.6
Applied egg-rr68.6%
(FPCore (x y z)
:precision binary64
(if (<= z -1e+67)
(fma
(* (* z z) (fma z (* z 0.027777777777777776) -0.25))
(/ 1.0 (fma z -0.16666666666666666 -0.5))
(- 1.0 z))
(exp x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1e+67) {
tmp = fma(((z * z) * fma(z, (z * 0.027777777777777776), -0.25)), (1.0 / fma(z, -0.16666666666666666, -0.5)), (1.0 - z));
} else {
tmp = exp(x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -1e+67) tmp = fma(Float64(Float64(z * z) * fma(z, Float64(z * 0.027777777777777776), -0.25)), Float64(1.0 / fma(z, -0.16666666666666666, -0.5)), Float64(1.0 - z)); else tmp = exp(x); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -1e+67], N[(N[(N[(z * z), $MachinePrecision] * N[(z * N[(z * 0.027777777777777776), $MachinePrecision] + -0.25), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(z * -0.16666666666666666 + -0.5), $MachinePrecision]), $MachinePrecision] + N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[Exp[x], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{fma}\left(\left(z \cdot z\right) \cdot \mathsf{fma}\left(z, z \cdot 0.027777777777777776, -0.25\right), \frac{1}{\mathsf{fma}\left(z, -0.16666666666666666, -0.5\right)}, 1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;e^{x}\\
\end{array}
\end{array}
if z < -9.99999999999999983e66Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6490.5
Simplified90.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6478.8
Simplified78.8%
lift-fma.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
distribute-lft-inN/A
associate-+l+N/A
associate-*r*N/A
lift-fma.f64N/A
flip-+N/A
div-invN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied egg-rr88.9%
if -9.99999999999999983e66 < z Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f6474.9
Simplified74.9%
Taylor expanded in z around 0
lower-exp.f6459.5
Simplified59.5%
Final simplification66.6%
(FPCore (x y z)
:precision binary64
(if (<= x -3.1e-5)
(* -0.16666666666666666 (* z (* z z)))
(if (<= x 2.8e+85)
(fma (* z (fma z (* z 0.25) -1.0)) (/ 1.0 (fma z 0.5 1.0)) 1.0)
(fma x (fma x (fma x 0.16666666666666666 0.5) 1.0) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e-5) {
tmp = -0.16666666666666666 * (z * (z * z));
} else if (x <= 2.8e+85) {
tmp = fma((z * fma(z, (z * 0.25), -1.0)), (1.0 / fma(z, 0.5, 1.0)), 1.0);
} else {
tmp = fma(x, fma(x, fma(x, 0.16666666666666666, 0.5), 1.0), 1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= -3.1e-5) tmp = Float64(-0.16666666666666666 * Float64(z * Float64(z * z))); elseif (x <= 2.8e+85) tmp = fma(Float64(z * fma(z, Float64(z * 0.25), -1.0)), Float64(1.0 / fma(z, 0.5, 1.0)), 1.0); else tmp = fma(x, fma(x, fma(x, 0.16666666666666666, 0.5), 1.0), 1.0); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, -3.1e-5], N[(-0.16666666666666666 * N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e+85], N[(N[(z * N[(z * N[(z * 0.25), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(z * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(x * N[(x * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-5}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(z \cdot \left(z \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \mathsf{fma}\left(z, z \cdot 0.25, -1\right), \frac{1}{\mathsf{fma}\left(z, 0.5, 1\right)}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
\end{array}
\end{array}
if x < -3.10000000000000014e-5Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6439.4
Simplified39.4%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6416.9
Simplified16.9%
Taylor expanded in z around inf
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6435.2
Simplified35.2%
if -3.10000000000000014e-5 < x < 2.7999999999999999e85Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6467.4
Simplified67.4%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6442.0
Simplified42.0%
lift-fma.f64N/A
*-commutativeN/A
lift-fma.f64N/A
flip-+N/A
associate-*l/N/A
div-invN/A
lower-fma.f64N/A
Applied egg-rr47.0%
if 2.7999999999999999e85 < x Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f64100.0
Simplified100.0%
Taylor expanded in z around 0
lower-exp.f6491.9
Simplified91.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.9
Simplified85.9%
Final simplification53.1%
(FPCore (x y z)
:precision binary64
(if (<= x -460.0)
(* -0.16666666666666666 (* z (* z z)))
(if (<= x 2.8e+85)
(fma z (fma z (fma z -0.16666666666666666 0.5) -1.0) 1.0)
(fma x (fma x (fma x 0.16666666666666666 0.5) 1.0) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -460.0) {
tmp = -0.16666666666666666 * (z * (z * z));
} else if (x <= 2.8e+85) {
tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0);
} else {
tmp = fma(x, fma(x, fma(x, 0.16666666666666666, 0.5), 1.0), 1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= -460.0) tmp = Float64(-0.16666666666666666 * Float64(z * Float64(z * z))); elseif (x <= 2.8e+85) tmp = fma(z, fma(z, fma(z, -0.16666666666666666, 0.5), -1.0), 1.0); else tmp = fma(x, fma(x, fma(x, 0.16666666666666666, 0.5), 1.0), 1.0); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, -460.0], N[(-0.16666666666666666 * N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e+85], N[(z * N[(z * N[(z * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(x * N[(x * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -460:\\
\;\;\;\;-0.16666666666666666 \cdot \left(z \cdot \left(z \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
\end{array}
\end{array}
if x < -460Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6435.7
Simplified35.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6413.2
Simplified13.2%
Taylor expanded in z around inf
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6432.7
Simplified32.7%
if -460 < x < 2.7999999999999999e85Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6468.4
Simplified68.4%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6443.5
Simplified43.5%
if 2.7999999999999999e85 < x Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f64100.0
Simplified100.0%
Taylor expanded in z around 0
lower-exp.f6491.9
Simplified91.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.9
Simplified85.9%
(FPCore (x y z)
:precision binary64
(if (<= x -3.1e-5)
(* -0.16666666666666666 (* z (* z z)))
(if (<= x 2.8e+85)
(fma z (fma z 0.5 -1.0) 1.0)
(fma x (fma x (fma x 0.16666666666666666 0.5) 1.0) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e-5) {
tmp = -0.16666666666666666 * (z * (z * z));
} else if (x <= 2.8e+85) {
tmp = fma(z, fma(z, 0.5, -1.0), 1.0);
} else {
tmp = fma(x, fma(x, fma(x, 0.16666666666666666, 0.5), 1.0), 1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= -3.1e-5) tmp = Float64(-0.16666666666666666 * Float64(z * Float64(z * z))); elseif (x <= 2.8e+85) tmp = fma(z, fma(z, 0.5, -1.0), 1.0); else tmp = fma(x, fma(x, fma(x, 0.16666666666666666, 0.5), 1.0), 1.0); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, -3.1e-5], N[(-0.16666666666666666 * N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e+85], N[(z * N[(z * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(x * N[(x * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-5}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(z \cdot \left(z \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666, 0.5\right), 1\right), 1\right)\\
\end{array}
\end{array}
if x < -3.10000000000000014e-5Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6439.4
Simplified39.4%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6416.9
Simplified16.9%
Taylor expanded in z around inf
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6435.2
Simplified35.2%
if -3.10000000000000014e-5 < x < 2.7999999999999999e85Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6467.4
Simplified67.4%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6442.0
Simplified42.0%
if 2.7999999999999999e85 < x Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f64100.0
Simplified100.0%
Taylor expanded in z around 0
lower-exp.f6491.9
Simplified91.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.9
Simplified85.9%
(FPCore (x y z)
:precision binary64
(if (<= x -3.1e-5)
(* -0.16666666666666666 (* z (* z z)))
(if (<= x 6.8e+135)
(fma z (fma z 0.5 -1.0) 1.0)
(fma x (fma x 0.5 1.0) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e-5) {
tmp = -0.16666666666666666 * (z * (z * z));
} else if (x <= 6.8e+135) {
tmp = fma(z, fma(z, 0.5, -1.0), 1.0);
} else {
tmp = fma(x, fma(x, 0.5, 1.0), 1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= -3.1e-5) tmp = Float64(-0.16666666666666666 * Float64(z * Float64(z * z))); elseif (x <= 6.8e+135) tmp = fma(z, fma(z, 0.5, -1.0), 1.0); else tmp = fma(x, fma(x, 0.5, 1.0), 1.0); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, -3.1e-5], N[(-0.16666666666666666 * N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.8e+135], N[(z * N[(z * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(x * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-5}:\\
\;\;\;\;-0.16666666666666666 \cdot \left(z \cdot \left(z \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\
\end{array}
\end{array}
if x < -3.10000000000000014e-5Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6439.4
Simplified39.4%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6416.9
Simplified16.9%
Taylor expanded in z around inf
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6435.2
Simplified35.2%
if -3.10000000000000014e-5 < x < 6.80000000000000019e135Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6465.1
Simplified65.1%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6439.5
Simplified39.5%
if 6.80000000000000019e135 < x Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f64100.0
Simplified100.0%
Taylor expanded in z around 0
lower-exp.f6491.6
Simplified91.6%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6481.9
Simplified81.9%
(FPCore (x y z)
:precision binary64
(if (<= x -460.0)
(* (* z z) 0.5)
(if (<= x 6.8e+135)
(fma z (fma z 0.5 -1.0) 1.0)
(fma x (fma x 0.5 1.0) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -460.0) {
tmp = (z * z) * 0.5;
} else if (x <= 6.8e+135) {
tmp = fma(z, fma(z, 0.5, -1.0), 1.0);
} else {
tmp = fma(x, fma(x, 0.5, 1.0), 1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= -460.0) tmp = Float64(Float64(z * z) * 0.5); elseif (x <= 6.8e+135) tmp = fma(z, fma(z, 0.5, -1.0), 1.0); else tmp = fma(x, fma(x, 0.5, 1.0), 1.0); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, -460.0], N[(N[(z * z), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 6.8e+135], N[(z * N[(z * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(x * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -460:\\
\;\;\;\;\left(z \cdot z\right) \cdot 0.5\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5, -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\
\end{array}
\end{array}
if x < -460Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6435.7
Simplified35.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6410.4
Simplified10.4%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f6425.4
Simplified25.4%
if -460 < x < 6.80000000000000019e135Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6466.1
Simplified66.1%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6440.5
Simplified40.5%
if 6.80000000000000019e135 < x Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f64100.0
Simplified100.0%
Taylor expanded in z around 0
lower-exp.f6491.6
Simplified91.6%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6481.9
Simplified81.9%
Final simplification44.3%
(FPCore (x y z) :precision binary64 (if (<= x -460.0) (* (* z z) 0.5) (if (<= x 6.8e+135) (fma z (* z 0.5) 1.0) (fma x (fma x 0.5 1.0) 1.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -460.0) {
tmp = (z * z) * 0.5;
} else if (x <= 6.8e+135) {
tmp = fma(z, (z * 0.5), 1.0);
} else {
tmp = fma(x, fma(x, 0.5, 1.0), 1.0);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= -460.0) tmp = Float64(Float64(z * z) * 0.5); elseif (x <= 6.8e+135) tmp = fma(z, Float64(z * 0.5), 1.0); else tmp = fma(x, fma(x, 0.5, 1.0), 1.0); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, -460.0], N[(N[(z * z), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 6.8e+135], N[(z * N[(z * 0.5), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(x * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -460:\\
\;\;\;\;\left(z \cdot z\right) \cdot 0.5\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(z, z \cdot 0.5, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, 1\right), 1\right)\\
\end{array}
\end{array}
if x < -460Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6435.7
Simplified35.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6410.4
Simplified10.4%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f6425.4
Simplified25.4%
if -460 < x < 6.80000000000000019e135Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6466.1
Simplified66.1%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6440.5
Simplified40.5%
Taylor expanded in z around inf
lower-*.f6440.4
Simplified40.4%
if 6.80000000000000019e135 < x Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f64100.0
Simplified100.0%
Taylor expanded in z around 0
lower-exp.f6491.6
Simplified91.6%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6481.9
Simplified81.9%
Final simplification44.2%
(FPCore (x y z) :precision binary64 (+ x 1.0))
double code(double x, double y, double z) {
return x + 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + 1.0d0
end function
public static double code(double x, double y, double z) {
return x + 1.0;
}
def code(x, y, z): return x + 1.0
function code(x, y, z) return Float64(x + 1.0) end
function tmp = code(x, y, z) tmp = x + 1.0; end
code[x_, y_, z_] := N[(x + 1.0), $MachinePrecision]
\begin{array}{l}
\\
x + 1
\end{array}
Initial program 100.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower--.f6480.6
Simplified80.6%
Taylor expanded in z around 0
lower-exp.f6455.3
Simplified55.3%
Taylor expanded in x around 0
lower-+.f6413.7
Simplified13.7%
Final simplification13.7%
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 1.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f6453.2
Simplified53.2%
Taylor expanded in z around 0
Simplified13.3%
(FPCore (x y z) :precision binary64 (exp (+ (- x z) (* (log y) y))))
double code(double x, double y, double z) {
return exp(((x - z) + (log(y) * y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = exp(((x - z) + (log(y) * y)))
end function
public static double code(double x, double y, double z) {
return Math.exp(((x - z) + (Math.log(y) * y)));
}
def code(x, y, z): return math.exp(((x - z) + (math.log(y) * y)))
function code(x, y, z) return exp(Float64(Float64(x - z) + Float64(log(y) * y))) end
function tmp = code(x, y, z) tmp = exp(((x - z) + (log(y) * y))); end
code[x_, y_, z_] := N[Exp[N[(N[(x - z), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(x - z\right) + \log y \cdot y}
\end{array}
herbie shell --seed 2024207
(FPCore (x y z)
:name "Statistics.Distribution.Poisson.Internal:probability from math-functions-0.1.5.2"
:precision binary64
:alt
(! :herbie-platform default (exp (+ (- x z) (* (log y) y))))
(exp (- (+ x (* y (log y))) z)))