
(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 -0.0001) (exp x) (if (<= t_0 1e+92) (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 <= -0.0001) {
tmp = exp(x);
} else if (t_0 <= 1e+92) {
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 <= (-0.0001d0)) then
tmp = exp(x)
else if (t_0 <= 1d+92) 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 <= -0.0001) {
tmp = Math.exp(x);
} else if (t_0 <= 1e+92) {
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 <= -0.0001: tmp = math.exp(x) elif t_0 <= 1e+92: 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 <= -0.0001) tmp = exp(x); elseif (t_0 <= 1e+92) 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 <= -0.0001) tmp = exp(x); elseif (t_0 <= 1e+92) 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, -0.0001], N[Exp[x], $MachinePrecision], If[LessEqual[t$95$0, 1e+92], 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 -0.0001:\\
\;\;\;\;e^{x}\\
\mathbf{elif}\;t\_0 \leq 10^{+92}:\\
\;\;\;\;e^{-z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if (+.f64 x (*.f64 y (log.f64 y))) < -1.00000000000000005e-4Initial program 100.0%
Taylor expanded in x around inf
Simplified87.4%
if -1.00000000000000005e-4 < (+.f64 x (*.f64 y (log.f64 y))) < 1e92Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6486.6
Simplified86.6%
if 1e92 < (+.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
*-lowering-*.f64N/A
log-lowering-log.f6475.5
Simplified75.5%
*-commutativeN/A
exp-to-powN/A
pow-lowering-pow.f6475.5
Applied egg-rr75.5%
(FPCore (x y z) :precision binary64 (let* ((t_0 (- (+ x (* y (log y))) z)) (t_1 (* (* z z) 0.5))) (if (<= t_0 -1e+37) t_1 (if (<= t_0 5e+112) 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 <= -1e+37) {
tmp = t_1;
} else if (t_0 <= 5e+112) {
tmp = 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 <= (-1d+37)) then
tmp = t_1
else if (t_0 <= 5d+112) then
tmp = 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 <= -1e+37) {
tmp = t_1;
} else if (t_0 <= 5e+112) {
tmp = 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 <= -1e+37: tmp = t_1 elif t_0 <= 5e+112: tmp = 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 <= -1e+37) tmp = t_1; elseif (t_0 <= 5e+112) tmp = 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 <= -1e+37) tmp = t_1; elseif (t_0 <= 5e+112) tmp = 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, -1e+37], t$95$1, If[LessEqual[t$95$0, 5e+112], 1.0, 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 -1 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+112}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < -9.99999999999999954e36 or 5e112 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6448.6
Simplified48.6%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f6426.6
Simplified26.6%
Taylor expanded in z around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6434.3
Simplified34.3%
if -9.99999999999999954e36 < (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z) < 5e112Initial program 100.0%
Taylor expanded in x around inf
Simplified63.1%
Taylor expanded in x around 0
Simplified50.0%
Final simplification37.9%
(FPCore (x y z) :precision binary64 (if (<= (exp (- (+ x (* y (log y))) z)) 0.0) (* (* z z) 0.5) (fma z (* z 0.5) 1.0)))
double code(double x, double y, double z) {
double tmp;
if (exp(((x + (y * log(y))) - z)) <= 0.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 (exp(Float64(Float64(x + Float64(y * log(y))) - z)) <= 0.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[Exp[N[(N[(x + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]], $MachinePrecision], 0.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}\;e^{\left(x + y \cdot \log y\right) - z} \leq 0:\\
\;\;\;\;\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 (exp.f64 (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z)) < 0.0Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6464.6
Simplified64.6%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f642.3
Simplified2.3%
Taylor expanded in z around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6423.5
Simplified23.5%
if 0.0 < (exp.f64 (-.f64 (+.f64 x (*.f64 y (log.f64 y))) z)) Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6447.1
Simplified47.1%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f6444.1
Simplified44.1%
Taylor expanded in z around inf
*-lowering-*.f6444.1
Simplified44.1%
Final simplification38.2%
(FPCore (x y z) :precision binary64 (if (<= (* y (log y)) 1e+161) (exp (- x z)) (pow y y)))
double code(double x, double y, double z) {
double tmp;
if ((y * log(y)) <= 1e+161) {
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)) <= 1d+161) 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)) <= 1e+161) {
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)) <= 1e+161: 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)) <= 1e+161) 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)) <= 1e+161) 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], 1e+161], 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 10^{+161}:\\
\;\;\;\;e^{x - z}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if (*.f64 y (log.f64 y)) < 1e161Initial program 100.0%
Taylor expanded in x around inf
Simplified91.1%
if 1e161 < (*.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
*-lowering-*.f64N/A
log-lowering-log.f6493.3
Simplified93.3%
*-commutativeN/A
exp-to-powN/A
pow-lowering-pow.f6493.3
Applied egg-rr93.3%
(FPCore (x y z) :precision binary64 (if (<= y 2.45e+63) (exp x) (pow y y)))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.45e+63) {
tmp = exp(x);
} 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 <= 2.45d+63) then
tmp = exp(x)
else
tmp = y ** y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 2.45e+63) {
tmp = Math.exp(x);
} else {
tmp = Math.pow(y, y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 2.45e+63: tmp = math.exp(x) else: tmp = math.pow(y, y) return tmp
function code(x, y, z) tmp = 0.0 if (y <= 2.45e+63) tmp = exp(x); else tmp = y ^ y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 2.45e+63) tmp = exp(x); else tmp = y ^ y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 2.45e+63], N[Exp[x], $MachinePrecision], N[Power[y, y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45 \cdot 10^{+63}:\\
\;\;\;\;e^{x}\\
\mathbf{else}:\\
\;\;\;\;{y}^{y}\\
\end{array}
\end{array}
if y < 2.4499999999999998e63Initial program 100.0%
Taylor expanded in x around inf
Simplified66.8%
if 2.4499999999999998e63 < 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
*-lowering-*.f64N/A
log-lowering-log.f6484.9
Simplified84.9%
*-commutativeN/A
exp-to-powN/A
pow-lowering-pow.f6484.9
Applied egg-rr84.9%
(FPCore (x y z)
:precision binary64
(if (<= z -5.8e+51)
(fma
z
(fma
(* z (fma (* z (* z z)) -0.004629629629629629 0.125))
(fma z -1.3333333333333333 4.0)
-1.0)
1.0)
(exp x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.8e+51) {
tmp = fma(z, fma((z * fma((z * (z * z)), -0.004629629629629629, 0.125)), fma(z, -1.3333333333333333, 4.0), -1.0), 1.0);
} else {
tmp = exp(x);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -5.8e+51) tmp = fma(z, fma(Float64(z * fma(Float64(z * Float64(z * z)), -0.004629629629629629, 0.125)), fma(z, -1.3333333333333333, 4.0), -1.0), 1.0); else tmp = exp(x); end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -5.8e+51], N[(z * N[(N[(z * N[(N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision] * -0.004629629629629629 + 0.125), $MachinePrecision]), $MachinePrecision] * N[(z * -1.3333333333333333 + 4.0), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[Exp[x], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z \cdot \mathsf{fma}\left(z \cdot \left(z \cdot z\right), -0.004629629629629629, 0.125\right), \mathsf{fma}\left(z, -1.3333333333333333, 4\right), -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;e^{x}\\
\end{array}
\end{array}
if z < -5.7999999999999997e51Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6498.1
Simplified98.1%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6487.0
Simplified87.0%
*-commutativeN/A
flip3-+N/A
associate-*l/N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr14.1%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6498.1
Simplified98.1%
if -5.7999999999999997e51 < z Initial program 100.0%
Taylor expanded in x around inf
Simplified56.2%
Final simplification64.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* z z))))
(if (<= x -4.3e+33)
(* t_0 -0.16666666666666666)
(if (<= x 5.5e+102)
(fma
z
(fma
(* z (fma t_0 -0.004629629629629629 0.125))
(fma z -1.3333333333333333 4.0)
-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 t_0 = z * (z * z);
double tmp;
if (x <= -4.3e+33) {
tmp = t_0 * -0.16666666666666666;
} else if (x <= 5.5e+102) {
tmp = fma(z, fma((z * fma(t_0, -0.004629629629629629, 0.125)), fma(z, -1.3333333333333333, 4.0), -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) t_0 = Float64(z * Float64(z * z)) tmp = 0.0 if (x <= -4.3e+33) tmp = Float64(t_0 * -0.16666666666666666); elseif (x <= 5.5e+102) tmp = fma(z, fma(Float64(z * fma(t_0, -0.004629629629629629, 0.125)), fma(z, -1.3333333333333333, 4.0), -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_] := Block[{t$95$0 = N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.3e+33], N[(t$95$0 * -0.16666666666666666), $MachinePrecision], If[LessEqual[x, 5.5e+102], N[(z * N[(N[(z * N[(t$95$0 * -0.004629629629629629 + 0.125), $MachinePrecision]), $MachinePrecision] * N[(z * -1.3333333333333333 + 4.0), $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}
t_0 := z \cdot \left(z \cdot z\right)\\
\mathbf{if}\;x \leq -4.3 \cdot 10^{+33}:\\
\;\;\;\;t\_0 \cdot -0.16666666666666666\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+102}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z \cdot \mathsf{fma}\left(t\_0, -0.004629629629629629, 0.125\right), \mathsf{fma}\left(z, -1.3333333333333333, 4\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 < -4.30000000000000028e33Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6445.5
Simplified45.5%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6423.2
Simplified23.2%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.3
Simplified57.3%
if -4.30000000000000028e33 < x < 5.49999999999999981e102Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6462.4
Simplified62.4%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6436.2
Simplified36.2%
*-commutativeN/A
flip3-+N/A
associate-*l/N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr23.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6443.5
Simplified43.5%
if 5.49999999999999981e102 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified95.8%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6495.8
Simplified95.8%
Final simplification56.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* z z))))
(if (<= x -4e+33)
(* t_0 -0.16666666666666666)
(if (<= x 5.9e+102)
(fma z (fma (* z (fma t_0 -0.004629629629629629 0.125)) 4.0 -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 t_0 = z * (z * z);
double tmp;
if (x <= -4e+33) {
tmp = t_0 * -0.16666666666666666;
} else if (x <= 5.9e+102) {
tmp = fma(z, fma((z * fma(t_0, -0.004629629629629629, 0.125)), 4.0, -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) t_0 = Float64(z * Float64(z * z)) tmp = 0.0 if (x <= -4e+33) tmp = Float64(t_0 * -0.16666666666666666); elseif (x <= 5.9e+102) tmp = fma(z, fma(Float64(z * fma(t_0, -0.004629629629629629, 0.125)), 4.0, -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_] := Block[{t$95$0 = N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4e+33], N[(t$95$0 * -0.16666666666666666), $MachinePrecision], If[LessEqual[x, 5.9e+102], N[(z * N[(N[(z * N[(t$95$0 * -0.004629629629629629 + 0.125), $MachinePrecision]), $MachinePrecision] * 4.0 + -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}
t_0 := z \cdot \left(z \cdot z\right)\\
\mathbf{if}\;x \leq -4 \cdot 10^{+33}:\\
\;\;\;\;t\_0 \cdot -0.16666666666666666\\
\mathbf{elif}\;x \leq 5.9 \cdot 10^{+102}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(z \cdot \mathsf{fma}\left(t\_0, -0.004629629629629629, 0.125\right), 4, -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.9999999999999998e33Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6445.5
Simplified45.5%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6423.2
Simplified23.2%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.3
Simplified57.3%
if -3.9999999999999998e33 < x < 5.90000000000000005e102Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6462.4
Simplified62.4%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6436.2
Simplified36.2%
*-commutativeN/A
flip3-+N/A
associate-*l/N/A
div-invN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr23.4%
Taylor expanded in z around 0
Simplified37.5%
if 5.90000000000000005e102 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified95.8%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6495.8
Simplified95.8%
Final simplification52.6%
(FPCore (x y z)
:precision binary64
(if (<= x -5.2e+29)
(* (* z (* z z)) -0.16666666666666666)
(if (<= x 1e+103)
(fma z (fma 0.5 z -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 <= -5.2e+29) {
tmp = (z * (z * z)) * -0.16666666666666666;
} else if (x <= 1e+103) {
tmp = fma(z, fma(0.5, z, -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 <= -5.2e+29) tmp = Float64(Float64(z * Float64(z * z)) * -0.16666666666666666); elseif (x <= 1e+103) tmp = fma(z, fma(0.5, z, -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, -5.2e+29], N[(N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666), $MachinePrecision], If[LessEqual[x, 1e+103], N[(z * N[(0.5 * z + -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 -5.2 \cdot 10^{+29}:\\
\;\;\;\;\left(z \cdot \left(z \cdot z\right)\right) \cdot -0.16666666666666666\\
\mathbf{elif}\;x \leq 10^{+103}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(0.5, z, -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 < -5.2e29Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6446.4
Simplified46.4%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6422.9
Simplified22.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.4
Simplified56.4%
if -5.2e29 < x < 1e103Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6462.1
Simplified62.1%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f6436.7
Simplified36.7%
if 1e103 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified95.8%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6495.8
Simplified95.8%
Final simplification52.0%
(FPCore (x y z)
:precision binary64
(if (<= x -4.7e+30)
(* (* z (* z z)) -0.16666666666666666)
(if (<= x 3.7e+121)
(fma z (fma 0.5 z -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 <= -4.7e+30) {
tmp = (z * (z * z)) * -0.16666666666666666;
} else if (x <= 3.7e+121) {
tmp = fma(z, fma(0.5, z, -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 <= -4.7e+30) tmp = Float64(Float64(z * Float64(z * z)) * -0.16666666666666666); elseif (x <= 3.7e+121) tmp = fma(z, fma(0.5, z, -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, -4.7e+30], N[(N[(z * N[(z * z), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666), $MachinePrecision], If[LessEqual[x, 3.7e+121], N[(z * N[(0.5 * z + -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 -4.7 \cdot 10^{+30}:\\
\;\;\;\;\left(z \cdot \left(z \cdot z\right)\right) \cdot -0.16666666666666666\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(0.5, z, -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 < -4.6999999999999999e30Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6446.4
Simplified46.4%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6422.9
Simplified22.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.4
Simplified56.4%
if -4.6999999999999999e30 < x < 3.70000000000000013e121Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6461.6
Simplified61.6%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f6436.9
Simplified36.9%
if 3.70000000000000013e121 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified97.5%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6485.8
Simplified85.8%
Final simplification48.8%
(FPCore (x y z)
:precision binary64
(if (<= x -4.8e+35)
(* (* z z) 0.5)
(if (<= x 3.7e+121)
(fma z (fma 0.5 z -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 <= -4.8e+35) {
tmp = (z * z) * 0.5;
} else if (x <= 3.7e+121) {
tmp = fma(z, fma(0.5, z, -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 <= -4.8e+35) tmp = Float64(Float64(z * z) * 0.5); elseif (x <= 3.7e+121) tmp = fma(z, fma(0.5, z, -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, -4.8e+35], N[(N[(z * z), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 3.7e+121], N[(z * N[(0.5 * z + -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 -4.8 \cdot 10^{+35}:\\
\;\;\;\;\left(z \cdot z\right) \cdot 0.5\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(0.5, z, -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 < -4.80000000000000029e35Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6445.3
Simplified45.3%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f6420.6
Simplified20.6%
Taylor expanded in z around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6449.0
Simplified49.0%
if -4.80000000000000029e35 < x < 3.70000000000000013e121Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6461.7
Simplified61.7%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f6436.8
Simplified36.8%
if 3.70000000000000013e121 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified97.5%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6485.8
Simplified85.8%
Final simplification46.9%
(FPCore (x y z) :precision binary64 (if (<= x -4.6e+35) (* (* z z) 0.5) (if (<= x 3.7e+121) (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 <= -4.6e+35) {
tmp = (z * z) * 0.5;
} else if (x <= 3.7e+121) {
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 <= -4.6e+35) tmp = Float64(Float64(z * z) * 0.5); elseif (x <= 3.7e+121) 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, -4.6e+35], N[(N[(z * z), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 3.7e+121], 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 -4.6 \cdot 10^{+35}:\\
\;\;\;\;\left(z \cdot z\right) \cdot 0.5\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+121}:\\
\;\;\;\;\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 < -4.5999999999999996e35Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6445.3
Simplified45.3%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f6420.6
Simplified20.6%
Taylor expanded in z around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6449.0
Simplified49.0%
if -4.5999999999999996e35 < x < 3.70000000000000013e121Initial program 100.0%
Taylor expanded in z around inf
mul-1-negN/A
neg-lowering-neg.f6461.7
Simplified61.7%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f6436.8
Simplified36.8%
Taylor expanded in z around inf
*-lowering-*.f6436.8
Simplified36.8%
if 3.70000000000000013e121 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified97.5%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6485.8
Simplified85.8%
Final simplification46.9%
(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 x around inf
Simplified51.6%
Taylor expanded in x around 0
+-lowering-+.f6414.1
Simplified14.1%
Final simplification14.1%
(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 x around inf
Simplified51.6%
Taylor expanded in x around 0
Simplified13.9%
(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 2024205
(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)))