
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - 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 - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - 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 - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
(FPCore (x y z t)
:precision binary64
(-
(fma
(+ -1.0 x)
(log y)
(*
(* y (fma y (fma y (fma y -0.25 -0.3333333333333333) -0.5) -1.0))
(+ -1.0 z)))
t))
double code(double x, double y, double z, double t) {
return fma((-1.0 + x), log(y), ((y * fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0)) * (-1.0 + z))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(-1.0 + x), log(y), Float64(Float64(y * fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0)) * Float64(-1.0 + z))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(-1.0 + x), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(N[(y * N[(y * N[(y * N[(y * -0.25 + -0.3333333333333333), $MachinePrecision] + -0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-1 + x, \log y, \left(y \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.25, -0.3333333333333333\right), -0.5\right), -1\right)\right) \cdot \left(-1 + z\right)\right) - t
\end{array}
Initial program 86.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6499.8
Simplified99.8%
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f6499.8
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) (+ -1.0 x)))
(t_2 (- (+ t_1 (* (+ -1.0 z) (log (- 1.0 y)))) t))
(t_3 (- (* x (log y)) t)))
(if (<= t_2 -5e+27)
t_3
(if (<= t_2 1e+15) t_1 (if (<= t_2 5e+46) (- y (fma y z t)) t_3)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * (-1.0 + x);
double t_2 = (t_1 + ((-1.0 + z) * log((1.0 - y)))) - t;
double t_3 = (x * log(y)) - t;
double tmp;
if (t_2 <= -5e+27) {
tmp = t_3;
} else if (t_2 <= 1e+15) {
tmp = t_1;
} else if (t_2 <= 5e+46) {
tmp = y - fma(y, z, t);
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(log(y) * Float64(-1.0 + x)) t_2 = Float64(Float64(t_1 + Float64(Float64(-1.0 + z) * log(Float64(1.0 - y)))) - t) t_3 = Float64(Float64(x * log(y)) - t) tmp = 0.0 if (t_2 <= -5e+27) tmp = t_3; elseif (t_2 <= 1e+15) tmp = t_1; elseif (t_2 <= 5e+46) tmp = Float64(y - fma(y, z, t)); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 + N[(N[(-1.0 + z), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+27], t$95$3, If[LessEqual[t$95$2, 1e+15], t$95$1, If[LessEqual[t$95$2, 5e+46], N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot \left(-1 + x\right)\\
t_2 := \left(t\_1 + \left(-1 + z\right) \cdot \log \left(1 - y\right)\right) - t\\
t_3 := x \cdot \log y - t\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+27}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+46}:\\
\;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < -4.99999999999999979e27 or 5.0000000000000002e46 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) Initial program 92.3%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6491.5
Simplified91.5%
if -4.99999999999999979e27 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 1e15Initial program 79.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6479.4
Simplified79.4%
Taylor expanded in t around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6476.4
Simplified76.4%
if 1e15 < (-.f64 (+.f64 (*.f64 (-.f64 x #s(literal 1 binary64)) (log.f64 y)) (*.f64 (-.f64 z #s(literal 1 binary64)) (log.f64 (-.f64 #s(literal 1 binary64) y)))) t) < 5.0000000000000002e46Initial program 33.3%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.8%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-outN/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6451.3
Simplified51.3%
Taylor expanded in y around 0
mul-1-negN/A
neg-sub0N/A
associate--r+N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
associate--r+N/A
neg-sub0N/A
mul-1-negN/A
remove-double-negN/A
--lowering--.f64N/A
accelerator-lowering-fma.f6480.7
Simplified80.7%
Final simplification86.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= (+ -1.0 x) -2e+121)
t_1
(if (<= (+ -1.0 x) -1.000000000010413)
(- y (fma y z t))
(if (<= (+ -1.0 x) -0.99)
(- 0.0 (+ (log y) t))
(if (<= (+ -1.0 x) 1e+63)
(- (* z (* y (fma y -0.5 -1.0))) t)
t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if ((-1.0 + x) <= -2e+121) {
tmp = t_1;
} else if ((-1.0 + x) <= -1.000000000010413) {
tmp = y - fma(y, z, t);
} else if ((-1.0 + x) <= -0.99) {
tmp = 0.0 - (log(y) + t);
} else if ((-1.0 + x) <= 1e+63) {
tmp = (z * (y * fma(y, -0.5, -1.0))) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (Float64(-1.0 + x) <= -2e+121) tmp = t_1; elseif (Float64(-1.0 + x) <= -1.000000000010413) tmp = Float64(y - fma(y, z, t)); elseif (Float64(-1.0 + x) <= -0.99) tmp = Float64(0.0 - Float64(log(y) + t)); elseif (Float64(-1.0 + x) <= 1e+63) tmp = Float64(Float64(z * Float64(y * fma(y, -0.5, -1.0))) - t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(-1.0 + x), $MachinePrecision], -2e+121], t$95$1, If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.000000000010413], N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], -0.99], N[(0.0 - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 1e+63], N[(N[(z * N[(y * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;-1 + x \leq -2 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;-1 + x \leq -1.000000000010413:\\
\;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\
\mathbf{elif}\;-1 + x \leq -0.99:\\
\;\;\;\;0 - \left(\log y + t\right)\\
\mathbf{elif}\;-1 + x \leq 10^{+63}:\\
\;\;\;\;z \cdot \left(y \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -2.00000000000000007e121 or 1.00000000000000006e63 < (-.f64 x #s(literal 1 binary64)) Initial program 93.7%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6474.0
Simplified74.0%
if -2.00000000000000007e121 < (-.f64 x #s(literal 1 binary64)) < -1.000000000010413Initial program 84.3%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-outN/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6438.4
Simplified38.4%
Taylor expanded in y around 0
mul-1-negN/A
neg-sub0N/A
associate--r+N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
associate--r+N/A
neg-sub0N/A
mul-1-negN/A
remove-double-negN/A
--lowering--.f64N/A
accelerator-lowering-fma.f6462.5
Simplified62.5%
if -1.000000000010413 < (-.f64 x #s(literal 1 binary64)) < -0.98999999999999999Initial program 86.1%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6485.3
Simplified85.3%
Taylor expanded in x around 0
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
neg-lowering-neg.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f6484.6
Simplified84.6%
if -0.98999999999999999 < (-.f64 x #s(literal 1 binary64)) < 1.00000000000000006e63Initial program 60.6%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified100.0%
Taylor expanded in z around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6464.3
Simplified64.3%
Final simplification76.6%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ -1.0 z) (* y (fma y (fma y -0.3333333333333333 -0.5) -1.0))) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return (((-1.0 + z) * (y * fma(y, fma(y, -0.3333333333333333, -0.5), -1.0))) + (log(y) * (-1.0 + x))) - t;
}
function code(x, y, z, t) return Float64(Float64(Float64(Float64(-1.0 + z) * Float64(y * fma(y, fma(y, -0.3333333333333333, -0.5), -1.0))) + Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(N[(-1.0 + z), $MachinePrecision] * N[(y * N[(y * N[(y * -0.3333333333333333 + -0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(-1 + z\right) \cdot \left(y \cdot \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.3333333333333333, -0.5\right), -1\right)\right) + \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 86.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6499.8
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (- (fma (+ -1.0 z) (* y (fma y -0.5 -1.0)) (* (log y) (+ -1.0 x))) t))
double code(double x, double y, double z, double t) {
return fma((-1.0 + z), (y * fma(y, -0.5, -1.0)), (log(y) * (-1.0 + x))) - t;
}
function code(x, y, z, t) return Float64(fma(Float64(-1.0 + z), Float64(y * fma(y, -0.5, -1.0)), Float64(log(y) * Float64(-1.0 + x))) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(-1.0 + z), $MachinePrecision] * N[(y * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-1 + z, y \cdot \mathsf{fma}\left(y, -0.5, -1\right), \log y \cdot \left(-1 + x\right)\right) - t
\end{array}
Initial program 86.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.7%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 x) -1.00000002)
(- (* (log y) (+ -1.0 x)) t)
(if (<= (+ -1.0 x) 2e+15)
(- (- y (fma y z t)) (log y))
(- (* x (log y)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + x) <= -1.00000002) {
tmp = (log(y) * (-1.0 + x)) - t;
} else if ((-1.0 + x) <= 2e+15) {
tmp = (y - fma(y, z, t)) - log(y);
} else {
tmp = (x * log(y)) - t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + x) <= -1.00000002) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); elseif (Float64(-1.0 + x) <= 2e+15) tmp = Float64(Float64(y - fma(y, z, t)) - log(y)); else tmp = Float64(Float64(x * log(y)) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + x), $MachinePrecision], -1.00000002], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(-1.0 + x), $MachinePrecision], 2e+15], N[(N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + x \leq -1.00000002:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{elif}\;-1 + x \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\left(y - \mathsf{fma}\left(y, z, t\right)\right) - \log y\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - t\\
\end{array}
\end{array}
if (-.f64 x #s(literal 1 binary64)) < -1.0000000200000001Initial program 91.3%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6491.3
Simplified91.3%
if -1.0000000200000001 < (-.f64 x #s(literal 1 binary64)) < 2e15Initial program 82.9%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate--l-N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.5
Simplified99.5%
Taylor expanded in x around 0
sub-negN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate--r+N/A
neg-sub0N/A
mul-1-negN/A
remove-double-negN/A
--lowering--.f64N/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f6498.1
Simplified98.1%
if 2e15 < (-.f64 x #s(literal 1 binary64)) Initial program 88.4%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6487.4
Simplified87.4%
Final simplification93.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- y (fma y z t))))
(if (<= (+ -1.0 z) -1e+204)
t_1
(if (<= (+ -1.0 z) 1e+279) (- (* (log y) (+ -1.0 x)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y - fma(y, z, t);
double tmp;
if ((-1.0 + z) <= -1e+204) {
tmp = t_1;
} else if ((-1.0 + z) <= 1e+279) {
tmp = (log(y) * (-1.0 + x)) - t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y - fma(y, z, t)) tmp = 0.0 if (Float64(-1.0 + z) <= -1e+204) tmp = t_1; elseif (Float64(-1.0 + z) <= 1e+279) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(-1.0 + z), $MachinePrecision], -1e+204], t$95$1, If[LessEqual[N[(-1.0 + z), $MachinePrecision], 1e+279], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \mathsf{fma}\left(y, z, t\right)\\
\mathbf{if}\;-1 + z \leq -1 \cdot 10^{+204}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;-1 + z \leq 10^{+279}:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 z #s(literal 1 binary64)) < -9.99999999999999989e203 or 1.00000000000000006e279 < (-.f64 z #s(literal 1 binary64)) Initial program 36.4%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-outN/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6411.6
Simplified11.6%
Taylor expanded in y around 0
mul-1-negN/A
neg-sub0N/A
associate--r+N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
associate--r+N/A
neg-sub0N/A
mul-1-negN/A
remove-double-negN/A
--lowering--.f64N/A
accelerator-lowering-fma.f6488.2
Simplified88.2%
if -9.99999999999999989e203 < (-.f64 z #s(literal 1 binary64)) < 1.00000000000000006e279Initial program 93.9%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6493.2
Simplified93.2%
Final simplification92.5%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.9e+46)
(- (* x (log y)) t)
(if (<= t 125000000.0)
(- (* (log y) (+ -1.0 x)) (* y z))
(fma (log y) x (- 0.0 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.9e+46) {
tmp = (x * log(y)) - t;
} else if (t <= 125000000.0) {
tmp = (log(y) * (-1.0 + x)) - (y * z);
} else {
tmp = fma(log(y), x, (0.0 - t));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= -2.9e+46) tmp = Float64(Float64(x * log(y)) - t); elseif (t <= 125000000.0) tmp = Float64(Float64(log(y) * Float64(-1.0 + x)) - Float64(y * z)); else tmp = fma(log(y), x, Float64(0.0 - t)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.9e+46], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t, 125000000.0], N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + N[(0.0 - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+46}:\\
\;\;\;\;x \cdot \log y - t\\
\mathbf{elif}\;t \leq 125000000:\\
\;\;\;\;\log y \cdot \left(-1 + x\right) - y \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, 0 - t\right)\\
\end{array}
\end{array}
if t < -2.9000000000000002e46Initial program 96.7%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6496.7
Simplified96.7%
if -2.9000000000000002e46 < t < 1.25e8Initial program 78.9%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate--l-N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.4
Simplified99.4%
Taylor expanded in z around inf
*-lowering-*.f6497.1
Simplified97.1%
if 1.25e8 < t Initial program 96.6%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6495.5
Simplified95.5%
sub-negN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
neg-sub0N/A
--lowering--.f6495.5
Applied egg-rr95.5%
Final simplification96.7%
(FPCore (x y z t)
:precision binary64
(if (<= (+ -1.0 z) -1e+146)
(- y (fma y z t))
(if (<= (+ -1.0 z) 4e+143)
(- 0.0 (+ (log y) t))
(-
(* (fma y (fma y (fma y -0.25 -0.3333333333333333) -0.5) -1.0) (* y z))
t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((-1.0 + z) <= -1e+146) {
tmp = y - fma(y, z, t);
} else if ((-1.0 + z) <= 4e+143) {
tmp = 0.0 - (log(y) + t);
} else {
tmp = (fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0) * (y * z)) - t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (Float64(-1.0 + z) <= -1e+146) tmp = Float64(y - fma(y, z, t)); elseif (Float64(-1.0 + z) <= 4e+143) tmp = Float64(0.0 - Float64(log(y) + t)); else tmp = Float64(Float64(fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0) * Float64(y * z)) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[N[(-1.0 + z), $MachinePrecision], -1e+146], N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(-1.0 + z), $MachinePrecision], 4e+143], N[(0.0 - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(y * N[(y * -0.25 + -0.3333333333333333), $MachinePrecision] + -0.5), $MachinePrecision] + -1.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-1 + z \leq -1 \cdot 10^{+146}:\\
\;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\
\mathbf{elif}\;-1 + z \leq 4 \cdot 10^{+143}:\\
\;\;\;\;0 - \left(\log y + t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.25, -0.3333333333333333\right), -0.5\right), -1\right) \cdot \left(y \cdot z\right) - t\\
\end{array}
\end{array}
if (-.f64 z #s(literal 1 binary64)) < -9.99999999999999934e145Initial program 43.4%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-outN/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6416.3
Simplified16.3%
Taylor expanded in y around 0
mul-1-negN/A
neg-sub0N/A
associate--r+N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
associate--r+N/A
neg-sub0N/A
mul-1-negN/A
remove-double-negN/A
--lowering--.f64N/A
accelerator-lowering-fma.f6474.9
Simplified74.9%
if -9.99999999999999934e145 < (-.f64 z #s(literal 1 binary64)) < 4.0000000000000001e143Initial program 97.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6497.8
Simplified97.8%
Taylor expanded in x around 0
sub-negN/A
mul-1-negN/A
distribute-neg-outN/A
neg-lowering-neg.f64N/A
+-lowering-+.f64N/A
log-lowering-log.f6463.0
Simplified63.0%
if 4.0000000000000001e143 < (-.f64 z #s(literal 1 binary64)) Initial program 70.7%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified99.8%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6472.8
Simplified72.8%
Final simplification66.2%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.15e+15)
(- y (fma y z t))
(if (<= t 1250.0)
(* (log y) (+ -1.0 x))
(- (* z (* y (- (/ (fma y 0.5 1.0) z) (fma y 0.5 1.0)))) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.15e+15) {
tmp = y - fma(y, z, t);
} else if (t <= 1250.0) {
tmp = log(y) * (-1.0 + x);
} else {
tmp = (z * (y * ((fma(y, 0.5, 1.0) / z) - fma(y, 0.5, 1.0)))) - t;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= -1.15e+15) tmp = Float64(y - fma(y, z, t)); elseif (t <= 1250.0) tmp = Float64(log(y) * Float64(-1.0 + x)); else tmp = Float64(Float64(z * Float64(y * Float64(Float64(fma(y, 0.5, 1.0) / z) - fma(y, 0.5, 1.0)))) - t); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.15e+15], N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1250.0], N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y * N[(N[(N[(y * 0.5 + 1.0), $MachinePrecision] / z), $MachinePrecision] - N[(y * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+15}:\\
\;\;\;\;y - \mathsf{fma}\left(y, z, t\right)\\
\mathbf{elif}\;t \leq 1250:\\
\;\;\;\;\log y \cdot \left(-1 + x\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(\frac{\mathsf{fma}\left(y, 0.5, 1\right)}{z} - \mathsf{fma}\left(y, 0.5, 1\right)\right)\right) - t\\
\end{array}
\end{array}
if t < -1.15e15Initial program 89.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-outN/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6463.4
Simplified63.4%
Taylor expanded in y around 0
mul-1-negN/A
neg-sub0N/A
associate--r+N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
associate--r+N/A
neg-sub0N/A
mul-1-negN/A
remove-double-negN/A
--lowering--.f64N/A
accelerator-lowering-fma.f6483.4
Simplified83.4%
if -1.15e15 < t < 1250Initial program 81.7%
Taylor expanded in y around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6481.0
Simplified81.0%
Taylor expanded in t around 0
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6480.1
Simplified80.1%
if 1250 < t Initial program 95.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-outN/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6449.2
Simplified49.2%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-/l*N/A
unpow2N/A
associate-*l*N/A
unpow2N/A
associate-*l*N/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified78.9%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (- (* (log y) (+ -1.0 x)) (fma y (+ -1.0 z) t)))
double code(double x, double y, double z, double t) {
return (log(y) * (-1.0 + x)) - fma(y, (-1.0 + z), t);
}
function code(x, y, z, t) return Float64(Float64(log(y) * Float64(-1.0 + x)) - fma(y, Float64(-1.0 + z), t)) end
code[x_, y_, z_, t_] := N[(N[(N[Log[y], $MachinePrecision] * N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] - N[(y * N[(-1.0 + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log y \cdot \left(-1 + x\right) - \mathsf{fma}\left(y, -1 + z, t\right)
\end{array}
Initial program 86.5%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate--l-N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.5
Simplified99.5%
(FPCore (x y z t) :precision binary64 (- (* z (* y (- (/ (fma y 0.5 1.0) z) (fma y 0.5 1.0)))) t))
double code(double x, double y, double z, double t) {
return (z * (y * ((fma(y, 0.5, 1.0) / z) - fma(y, 0.5, 1.0)))) - t;
}
function code(x, y, z, t) return Float64(Float64(z * Float64(y * Float64(Float64(fma(y, 0.5, 1.0) / z) - fma(y, 0.5, 1.0)))) - t) end
code[x_, y_, z_, t_] := N[(N[(z * N[(y * N[(N[(N[(y * 0.5 + 1.0), $MachinePrecision] / z), $MachinePrecision] - N[(y * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(y \cdot \left(\frac{\mathsf{fma}\left(y, 0.5, 1\right)}{z} - \mathsf{fma}\left(y, 0.5, 1\right)\right)\right) - t
\end{array}
Initial program 86.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-outN/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6432.4
Simplified32.4%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate-/l*N/A
unpow2N/A
associate-*l*N/A
unpow2N/A
associate-*l*N/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified48.8%
(FPCore (x y z t) :precision binary64 (- (* (+ -0.5 (/ -1.0 y)) (* y (* y (+ -1.0 z)))) t))
double code(double x, double y, double z, double t) {
return ((-0.5 + (-1.0 / y)) * (y * (y * (-1.0 + 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 = (((-0.5d0) + ((-1.0d0) / y)) * (y * (y * ((-1.0d0) + z)))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((-0.5 + (-1.0 / y)) * (y * (y * (-1.0 + z)))) - t;
}
def code(x, y, z, t): return ((-0.5 + (-1.0 / y)) * (y * (y * (-1.0 + z)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(-0.5 + Float64(-1.0 / y)) * Float64(y * Float64(y * Float64(-1.0 + z)))) - t) end
function tmp = code(x, y, z, t) tmp = ((-0.5 + (-1.0 / y)) * (y * (y * (-1.0 + z)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(-0.5 + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision] * N[(y * N[(y * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(-0.5 + \frac{-1}{y}\right) \cdot \left(y \cdot \left(y \cdot \left(-1 + z\right)\right)\right) - t
\end{array}
Initial program 86.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-outN/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6432.4
Simplified32.4%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f6448.7
Applied egg-rr48.7%
(FPCore (x y z t) :precision binary64 (- (* (fma y (fma y (fma y -0.25 -0.3333333333333333) -0.5) -1.0) (* y z)) t))
double code(double x, double y, double z, double t) {
return (fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0) * (y * z)) - t;
}
function code(x, y, z, t) return Float64(Float64(fma(y, fma(y, fma(y, -0.25, -0.3333333333333333), -0.5), -1.0) * Float64(y * z)) - t) end
code[x_, y_, z_, t_] := N[(N[(N[(y * N[(y * N[(y * -0.25 + -0.3333333333333333), $MachinePrecision] + -0.5), $MachinePrecision] + -1.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.25, -0.3333333333333333\right), -0.5\right), -1\right) \cdot \left(y \cdot z\right) - t
\end{array}
Initial program 86.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
Simplified99.8%
Taylor expanded in z around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6448.7
Simplified48.7%
(FPCore (x y z t) :precision binary64 (if (<= t -2.6e+21) (- 0.0 t) (if (<= t 12500000.0) (* y (- 1.0 z)) (- 0.0 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.6e+21) {
tmp = 0.0 - t;
} else if (t <= 12500000.0) {
tmp = y * (1.0 - z);
} else {
tmp = 0.0 - 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 (t <= (-2.6d+21)) then
tmp = 0.0d0 - t
else if (t <= 12500000.0d0) then
tmp = y * (1.0d0 - z)
else
tmp = 0.0d0 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.6e+21) {
tmp = 0.0 - t;
} else if (t <= 12500000.0) {
tmp = y * (1.0 - z);
} else {
tmp = 0.0 - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.6e+21: tmp = 0.0 - t elif t <= 12500000.0: tmp = y * (1.0 - z) else: tmp = 0.0 - t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.6e+21) tmp = Float64(0.0 - t); elseif (t <= 12500000.0) tmp = Float64(y * Float64(1.0 - z)); else tmp = Float64(0.0 - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.6e+21) tmp = 0.0 - t; elseif (t <= 12500000.0) tmp = y * (1.0 - z); else tmp = 0.0 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.6e+21], N[(0.0 - t), $MachinePrecision], If[LessEqual[t, 12500000.0], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(0.0 - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+21}:\\
\;\;\;\;0 - t\\
\mathbf{elif}\;t \leq 12500000:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;0 - t\\
\end{array}
\end{array}
if t < -2.6e21 or 1.25e7 < t Initial program 95.9%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6476.5
Simplified76.5%
sub0-negN/A
neg-lowering-neg.f6476.5
Applied egg-rr76.5%
if -2.6e21 < t < 1.25e7Initial program 79.1%
Taylor expanded in y around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
associate--l-N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f6499.4
Simplified99.4%
Taylor expanded in y around inf
sub-negN/A
neg-mul-1N/A
+-commutativeN/A
neg-mul-1N/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
associate--r+N/A
metadata-evalN/A
--lowering--.f6423.2
Simplified23.2%
Final simplification46.5%
(FPCore (x y z t) :precision binary64 (- (* z (* y (fma y -0.5 -1.0))) t))
double code(double x, double y, double z, double t) {
return (z * (y * fma(y, -0.5, -1.0))) - t;
}
function code(x, y, z, t) return Float64(Float64(z * Float64(y * fma(y, -0.5, -1.0))) - t) end
code[x_, y_, z_, t_] := N[(N[(z * N[(y * N[(y * -0.5 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(y \cdot \mathsf{fma}\left(y, -0.5, -1\right)\right) - t
\end{array}
Initial program 86.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.7%
Taylor expanded in z around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6448.6
Simplified48.6%
(FPCore (x y z t) :precision binary64 (- y (fma y z t)))
double code(double x, double y, double z, double t) {
return y - fma(y, z, t);
}
function code(x, y, z, t) return Float64(y - fma(y, z, t)) end
code[x_, y_, z_, t_] := N[(y - N[(y * z + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y - \mathsf{fma}\left(y, z, t\right)
\end{array}
Initial program 86.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
Simplified99.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-outN/A
metadata-evalN/A
metadata-evalN/A
distribute-neg-fracN/A
distribute-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6432.4
Simplified32.4%
Taylor expanded in y around 0
mul-1-negN/A
neg-sub0N/A
associate--r+N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
*-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
associate--r+N/A
neg-sub0N/A
mul-1-negN/A
remove-double-negN/A
--lowering--.f64N/A
accelerator-lowering-fma.f6448.6
Simplified48.6%
(FPCore (x y z t) :precision binary64 (- 0.0 t))
double code(double x, double y, double z, double t) {
return 0.0 - 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 = 0.0d0 - t
end function
public static double code(double x, double y, double z, double t) {
return 0.0 - t;
}
def code(x, y, z, t): return 0.0 - t
function code(x, y, z, t) return Float64(0.0 - t) end
function tmp = code(x, y, z, t) tmp = 0.0 - t; end
code[x_, y_, z_, t_] := N[(0.0 - t), $MachinePrecision]
\begin{array}{l}
\\
0 - t
\end{array}
Initial program 86.5%
Taylor expanded in t around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6435.4
Simplified35.4%
sub0-negN/A
neg-lowering-neg.f6435.4
Applied egg-rr35.4%
Final simplification35.4%
herbie shell --seed 2024195
(FPCore (x y z t)
:name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"
:precision binary64
(- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))