
(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z): return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z) return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) end
function tmp = code(x, y, z) tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y))); end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z): return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z) return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) end
function tmp = code(x, y, z) tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y))); end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<= z -17.0)
(+ x (/ -1.0 x))
(if (<= z 9.0)
(+
x
(/
y
(fma
z
(fma
z
(fma z 0.18806319451591877 0.5641895835477563)
1.1283791670955126)
(- 1.1283791670955126 (* x y)))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -17.0) {
tmp = x + (-1.0 / x);
} else if (z <= 9.0) {
tmp = x + (y / fma(z, fma(z, fma(z, 0.18806319451591877, 0.5641895835477563), 1.1283791670955126), (1.1283791670955126 - (x * y))));
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -17.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 9.0) tmp = Float64(x + Float64(y / fma(z, fma(z, fma(z, 0.18806319451591877, 0.5641895835477563), 1.1283791670955126), Float64(1.1283791670955126 - Float64(x * y))))); else tmp = x; end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -17.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x + N[(y / N[(z * N[(z * N[(z * 0.18806319451591877 + 0.5641895835477563), $MachinePrecision] + 1.1283791670955126), $MachinePrecision] + N[(1.1283791670955126 - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -17:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 9:\\
\;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.18806319451591877, 0.5641895835477563\right), 1.1283791670955126\right), 1.1283791670955126 - x \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -17Initial program 94.2%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if -17 < z < 9Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
associate--l+N/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.6%
Simplified99.6%
if 9 < z Initial program 93.3%
Taylor expanded in x around inf
Simplified100.0%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y)))))) (if (<= t_0 5e+262) t_0 (+ x (/ -1.0 x)))))
double code(double x, double y, double z) {
double t_0 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
double tmp;
if (t_0 <= 5e+262) {
tmp = t_0;
} else {
tmp = x + (-1.0 / 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) :: t_0
real(8) :: tmp
t_0 = x + (y / ((exp(z) * 1.1283791670955126d0) - (x * y)))
if (t_0 <= 5d+262) then
tmp = t_0
else
tmp = x + ((-1.0d0) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
double tmp;
if (t_0 <= 5e+262) {
tmp = t_0;
} else {
tmp = x + (-1.0 / x);
}
return tmp;
}
def code(x, y, z): t_0 = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y))) tmp = 0 if t_0 <= 5e+262: tmp = t_0 else: tmp = x + (-1.0 / x) return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y / Float64(Float64(exp(z) * 1.1283791670955126) - Float64(x * y)))) tmp = 0.0 if (t_0 <= 5e+262) tmp = t_0; else tmp = Float64(x + Float64(-1.0 / x)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y / ((exp(z) * 1.1283791670955126) - (x * y))); tmp = 0.0; if (t_0 <= 5e+262) tmp = t_0; else tmp = x + (-1.0 / x); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y / N[(N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+262], t$95$0, N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+262}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{x}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 5.00000000000000008e262Initial program 99.4%
if 5.00000000000000008e262 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) Initial program 65.3%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (fma (/ -1.0 (fma x y (* (exp z) -1.1283791670955126))) y x))
double code(double x, double y, double z) {
return fma((-1.0 / fma(x, y, (exp(z) * -1.1283791670955126))), y, x);
}
function code(x, y, z) return fma(Float64(-1.0 / fma(x, y, Float64(exp(z) * -1.1283791670955126))), y, x) end
code[x_, y_, z_] := N[(N[(-1.0 / N[(x * y + N[(N[Exp[z], $MachinePrecision] * -1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{-1}{\mathsf{fma}\left(x, y, e^{z} \cdot -1.1283791670955126\right)}, y, x\right)
\end{array}
Initial program 97.1%
+-commutativeN/A
*-lft-identityN/A
associate-*l/N/A
flip--N/A
clear-numN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr98.7%
(FPCore (x y z)
:precision binary64
(if (<= z -350.0)
(+ x (/ -1.0 x))
(if (<= z 9.0)
(+
x
(/
y
(-
(fma
z
(fma z 0.5641895835477563 1.1283791670955126)
1.1283791670955126)
(* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -350.0) {
tmp = x + (-1.0 / x);
} else if (z <= 9.0) {
tmp = x + (y / (fma(z, fma(z, 0.5641895835477563, 1.1283791670955126), 1.1283791670955126) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -350.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 9.0) tmp = Float64(x + Float64(y / Float64(fma(z, fma(z, 0.5641895835477563, 1.1283791670955126), 1.1283791670955126) - Float64(x * y)))); else tmp = x; end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -350.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x + N[(y / N[(N[(z * N[(z * 0.5641895835477563 + 1.1283791670955126), $MachinePrecision] + 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -350:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 9:\\
\;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.5641895835477563, 1.1283791670955126\right), 1.1283791670955126\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -350Initial program 94.2%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if -350 < z < 9Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.5%
Simplified99.5%
if 9 < z Initial program 93.3%
Taylor expanded in x around inf
Simplified100.0%
(FPCore (x y z)
:precision binary64
(if (<= z -225.0)
(+ x (/ -1.0 x))
(if (<= z 9.0)
(+
x
(/ y (fma y (- 0.0 x) (fma z 1.1283791670955126 1.1283791670955126))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -225.0) {
tmp = x + (-1.0 / x);
} else if (z <= 9.0) {
tmp = x + (y / fma(y, (0.0 - x), fma(z, 1.1283791670955126, 1.1283791670955126)));
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -225.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 9.0) tmp = Float64(x + Float64(y / fma(y, Float64(0.0 - x), fma(z, 1.1283791670955126, 1.1283791670955126)))); else tmp = x; end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -225.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x + N[(y / N[(y * N[(0.0 - x), $MachinePrecision] + N[(z * 1.1283791670955126 + 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -225:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 9:\\
\;\;\;\;x + \frac{y}{\mathsf{fma}\left(y, 0 - x, \mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -225Initial program 94.2%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if -225 < z < 9Initial program 99.8%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.4%
Simplified99.4%
if 9 < z Initial program 93.3%
Taylor expanded in x around inf
Simplified100.0%
(FPCore (x y z)
:precision binary64
(if (<= z -150.0)
(+ x (/ -1.0 x))
(if (<= z 9.0)
(+ x (/ y (- (fma z 1.1283791670955126 1.1283791670955126) (* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -150.0) {
tmp = x + (-1.0 / x);
} else if (z <= 9.0) {
tmp = x + (y / (fma(z, 1.1283791670955126, 1.1283791670955126) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -150.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 9.0) tmp = Float64(x + Float64(y / Float64(fma(z, 1.1283791670955126, 1.1283791670955126) - Float64(x * y)))); else tmp = x; end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -150.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x + N[(y / N[(N[(z * 1.1283791670955126 + 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -150:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 9:\\
\;\;\;\;x + \frac{y}{\mathsf{fma}\left(z, 1.1283791670955126, 1.1283791670955126\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -150Initial program 94.2%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if -150 < z < 9Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6499.4%
Simplified99.4%
if 9 < z Initial program 93.3%
Taylor expanded in x around inf
Simplified100.0%
(FPCore (x y z) :precision binary64 (if (<= z -95.0) (+ x (/ -1.0 x)) (if (<= z 9.0) (- x (/ y (fma y x -1.1283791670955126))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -95.0) {
tmp = x + (-1.0 / x);
} else if (z <= 9.0) {
tmp = x - (y / fma(y, x, -1.1283791670955126));
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -95.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 9.0) tmp = Float64(x - Float64(y / fma(y, x, -1.1283791670955126))); else tmp = x; end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -95.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.0], N[(x - N[(y / N[(y * x + -1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -95:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 9:\\
\;\;\;\;x - \frac{y}{\mathsf{fma}\left(y, x, -1.1283791670955126\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -95Initial program 94.2%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if -95 < z < 9Initial program 99.8%
+-commutativeN/A
*-lft-identityN/A
associate-*l/N/A
flip--N/A
clear-numN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr99.7%
Taylor expanded in z around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6499.0%
Simplified99.0%
if 9 < z Initial program 93.3%
Taylor expanded in x around inf
Simplified100.0%
(FPCore (x y z)
:precision binary64
(if (<= x -4.3e-21)
x
(if (<= x 2.9e-37)
(fma 0.8862269254527579 y x)
(if (<= x 4.2e-8) (/ -1.0 x) x))))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.3e-21) {
tmp = x;
} else if (x <= 2.9e-37) {
tmp = fma(0.8862269254527579, y, x);
} else if (x <= 4.2e-8) {
tmp = -1.0 / x;
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= -4.3e-21) tmp = x; elseif (x <= 2.9e-37) tmp = fma(0.8862269254527579, y, x); elseif (x <= 4.2e-8) tmp = Float64(-1.0 / x); else tmp = x; end return tmp end
code[x_, y_, z_] := If[LessEqual[x, -4.3e-21], x, If[LessEqual[x, 2.9e-37], N[(0.8862269254527579 * y + x), $MachinePrecision], If[LessEqual[x, 4.2e-8], N[(-1.0 / x), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{-21}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-37}:\\
\;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-8}:\\
\;\;\;\;\frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.2999999999999998e-21 or 4.19999999999999989e-8 < x Initial program 97.1%
Taylor expanded in x around inf
Simplified98.0%
if -4.2999999999999998e-21 < x < 2.90000000000000005e-37Initial program 97.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6473.4%
Simplified73.4%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f6454.8%
Simplified54.8%
if 2.90000000000000005e-37 < x < 4.19999999999999989e-8Initial program 99.7%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
/-lowering-/.f64100.0%
Simplified100.0%
(FPCore (x y z) :precision binary64 (if (<= z -0.004) (+ x (/ -1.0 x)) (if (<= z 1.7e-13) (fma 0.8862269254527579 y x) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.004) {
tmp = x + (-1.0 / x);
} else if (z <= 1.7e-13) {
tmp = fma(0.8862269254527579, y, x);
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (z <= -0.004) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 1.7e-13) tmp = fma(0.8862269254527579, y, x); else tmp = x; end return tmp end
code[x_, y_, z_] := If[LessEqual[z, -0.004], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-13], N[(0.8862269254527579 * y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.004:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -0.0040000000000000001Initial program 94.2%
Taylor expanded in y around inf
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64100.0%
Simplified100.0%
if -0.0040000000000000001 < z < 1.70000000000000008e-13Initial program 99.8%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6498.9%
Simplified98.9%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f6475.9%
Simplified75.9%
if 1.70000000000000008e-13 < z Initial program 93.3%
Taylor expanded in x around inf
Simplified100.0%
(FPCore (x y z) :precision binary64 (if (<= x -1.75e-21) x (if (<= x 8.4e-16) (fma 0.8862269254527579 y x) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.75e-21) {
tmp = x;
} else if (x <= 8.4e-16) {
tmp = fma(0.8862269254527579, y, x);
} else {
tmp = x;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= -1.75e-21) tmp = x; elseif (x <= 8.4e-16) tmp = fma(0.8862269254527579, y, x); else tmp = x; end return tmp end
code[x_, y_, z_] := If[LessEqual[x, -1.75e-21], x, If[LessEqual[x, 8.4e-16], N[(0.8862269254527579 * y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{-21}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 8.4 \cdot 10^{-16}:\\
\;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.7500000000000002e-21 or 8.4000000000000004e-16 < x Initial program 97.1%
Taylor expanded in x around inf
Simplified97.3%
if -1.7500000000000002e-21 < x < 8.4000000000000004e-16Initial program 97.2%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6472.8%
Simplified72.8%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f6452.6%
Simplified52.6%
(FPCore (x y z) :precision binary64 (if (<= x -8.5e-193) x (if (<= x 4.5e-248) (* y 0.8862269254527579) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -8.5e-193) {
tmp = x;
} else if (x <= 4.5e-248) {
tmp = y * 0.8862269254527579;
} else {
tmp = 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 <= (-8.5d-193)) then
tmp = x
else if (x <= 4.5d-248) then
tmp = y * 0.8862269254527579d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -8.5e-193) {
tmp = x;
} else if (x <= 4.5e-248) {
tmp = y * 0.8862269254527579;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -8.5e-193: tmp = x elif x <= 4.5e-248: tmp = y * 0.8862269254527579 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -8.5e-193) tmp = x; elseif (x <= 4.5e-248) tmp = Float64(y * 0.8862269254527579); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -8.5e-193) tmp = x; elseif (x <= 4.5e-248) tmp = y * 0.8862269254527579; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -8.5e-193], x, If[LessEqual[x, 4.5e-248], N[(y * 0.8862269254527579), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-193}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-248}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -8.50000000000000004e-193 or 4.4999999999999996e-248 < x Initial program 97.6%
Taylor expanded in x around inf
Simplified77.9%
if -8.50000000000000004e-193 < x < 4.4999999999999996e-248Initial program 95.2%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6466.3%
Simplified66.3%
Taylor expanded in x around 0
*-lowering-*.f6456.6%
Simplified56.6%
Final simplification74.2%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 97.1%
Taylor expanded in x around inf
Simplified67.8%
(FPCore (x y z) :precision binary64 (+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x))))
double code(double x, double y, double z) {
return x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x));
}
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 / (((1.1283791670955126d0 / y) * exp(z)) - x))
end function
public static double code(double x, double y, double z) {
return x + (1.0 / (((1.1283791670955126 / y) * Math.exp(z)) - x));
}
def code(x, y, z): return x + (1.0 / (((1.1283791670955126 / y) * math.exp(z)) - x))
function code(x, y, z) return Float64(x + Float64(1.0 / Float64(Float64(Float64(1.1283791670955126 / y) * exp(z)) - x))) end
function tmp = code(x, y, z) tmp = x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x)); end
code[x_, y_, z_] := N[(x + N[(1.0 / N[(N[(N[(1.1283791670955126 / y), $MachinePrecision] * N[Exp[z], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x}
\end{array}
herbie shell --seed 2024193
(FPCore (x y z)
:name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ 1 (- (* (/ 5641895835477563/5000000000000000 y) (exp z)) x))))
(+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))