
(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 11 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 -7000000.0)
(+ x (/ -1.0 x))
(if (<= z 2.5e-5)
(+ x (/ y (+ 1.1283791670955126 (- (* z 1.1283791670955126) (* x y)))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -7000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.5e-5) {
tmp = x + (y / (1.1283791670955126 + ((z * 1.1283791670955126) - (x * y))));
} 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 (z <= (-7000000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 2.5d-5) then
tmp = x + (y / (1.1283791670955126d0 + ((z * 1.1283791670955126d0) - (x * y))))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -7000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.5e-5) {
tmp = x + (y / (1.1283791670955126 + ((z * 1.1283791670955126) - (x * y))));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -7000000.0: tmp = x + (-1.0 / x) elif z <= 2.5e-5: tmp = x + (y / (1.1283791670955126 + ((z * 1.1283791670955126) - (x * y)))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -7000000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 2.5e-5) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 + Float64(Float64(z * 1.1283791670955126) - Float64(x * y))))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -7000000.0) tmp = x + (-1.0 / x); elseif (z <= 2.5e-5) tmp = x + (y / (1.1283791670955126 + ((z * 1.1283791670955126) - (x * y)))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -7000000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-5], N[(x + N[(y / N[(1.1283791670955126 + N[(N[(z * 1.1283791670955126), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7000000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-5}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 + \left(z \cdot 1.1283791670955126 - x \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7e6Initial program 93.9%
*-lft-identity93.9%
metadata-eval93.9%
times-frac93.9%
neg-mul-193.9%
sub0-neg93.7%
associate-+l-93.7%
neg-sub093.9%
+-commutative93.9%
sub-neg93.9%
associate-/l*94.1%
div-sub94.1%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -7e6 < z < 2.50000000000000012e-5Initial program 99.9%
Taylor expanded in z around 0 99.9%
associate--l+99.9%
*-commutative99.9%
Simplified99.9%
if 2.50000000000000012e-5 < z Initial program 93.0%
*-lft-identity93.0%
metadata-eval93.0%
times-frac93.0%
neg-mul-193.0%
sub0-neg93.0%
associate-+l-93.0%
neg-sub093.0%
+-commutative93.0%
sub-neg93.0%
associate-/l*93.0%
div-sub93.0%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 50.5%
Taylor expanded in x around inf 100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y)))))) (if (<= t_0 4e+252) 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 <= 4e+252) {
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 <= 4d+252) 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 <= 4e+252) {
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 <= 4e+252: 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 <= 4e+252) 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 <= 4e+252) 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, 4e+252], 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 4 \cdot 10^{+252}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{x}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))) < 4.0000000000000004e252Initial program 99.5%
if 4.0000000000000004e252 < (+.f64 x (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))) Initial program 68.5%
*-lft-identity68.5%
metadata-eval68.5%
times-frac68.5%
neg-mul-168.5%
sub0-neg68.4%
associate-+l-68.4%
neg-sub068.6%
+-commutative68.6%
sub-neg68.6%
associate-/l*68.6%
div-sub68.6%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (+ x (/ -1.0 (fma (exp z) (/ -1.1283791670955126 y) x))))
double code(double x, double y, double z) {
return x + (-1.0 / fma(exp(z), (-1.1283791670955126 / y), x));
}
function code(x, y, z) return Float64(x + Float64(-1.0 / fma(exp(z), Float64(-1.1283791670955126 / y), x))) end
code[x_, y_, z_] := N[(x + N[(-1.0 / N[(N[Exp[z], $MachinePrecision] * N[(-1.1283791670955126 / y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-1}{\mathsf{fma}\left(e^{z}, \frac{-1.1283791670955126}{y}, x\right)}
\end{array}
Initial program 96.6%
*-lft-identity96.6%
metadata-eval96.6%
times-frac96.6%
neg-mul-196.6%
sub0-neg96.5%
associate-+l-96.5%
neg-sub096.6%
+-commutative96.6%
sub-neg96.6%
associate-/l*96.6%
div-sub96.6%
associate-*r/99.9%
*-inverses99.9%
*-rgt-identity99.9%
associate-*l/99.9%
cancel-sign-sub-inv99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
associate-*l/99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= z -8.2e-42)
(+ x (/ -1.0 x))
(if (<= z 2.6e-6)
(+ x (/ y (+ 1.1283791670955126 (* z 1.1283791670955126))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -8.2e-42) {
tmp = x + (-1.0 / x);
} else if (z <= 2.6e-6) {
tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126)));
} 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 (z <= (-8.2d-42)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 2.6d-6) then
tmp = x + (y / (1.1283791670955126d0 + (z * 1.1283791670955126d0)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -8.2e-42) {
tmp = x + (-1.0 / x);
} else if (z <= 2.6e-6) {
tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -8.2e-42: tmp = x + (-1.0 / x) elif z <= 2.6e-6: tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -8.2e-42) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 2.6e-6) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 + Float64(z * 1.1283791670955126)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -8.2e-42) tmp = x + (-1.0 / x); elseif (z <= 2.6e-6) tmp = x + (y / (1.1283791670955126 + (z * 1.1283791670955126))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -8.2e-42], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-6], N[(x + N[(y / N[(1.1283791670955126 + N[(z * 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-42}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-6}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 + z \cdot 1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.2000000000000003e-42Initial program 94.8%
*-lft-identity94.8%
metadata-eval94.8%
times-frac94.8%
neg-mul-194.8%
sub0-neg94.6%
associate-+l-94.6%
neg-sub094.9%
+-commutative94.9%
sub-neg94.9%
associate-/l*95.0%
div-sub95.0%
associate-*r/99.9%
*-inverses99.9%
*-rgt-identity99.9%
associate-*l/99.9%
cancel-sign-sub-inv99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
associate-*l/99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Taylor expanded in x around inf 94.8%
if -8.2000000000000003e-42 < z < 2.60000000000000009e-6Initial program 99.9%
Taylor expanded in z around 0 99.9%
associate--l+99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 79.5%
if 2.60000000000000009e-6 < z Initial program 93.0%
*-lft-identity93.0%
metadata-eval93.0%
times-frac93.0%
neg-mul-193.0%
sub0-neg93.0%
associate-+l-93.0%
neg-sub093.0%
+-commutative93.0%
sub-neg93.0%
associate-/l*93.0%
div-sub93.0%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 50.5%
Taylor expanded in x around inf 100.0%
Final simplification89.4%
(FPCore (x y z) :precision binary64 (if (<= z -7000000.0) (+ x (/ -1.0 x)) (if (<= z 2.5e-5) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -7000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.5e-5) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} 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 (z <= (-7000000.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 2.5d-5) then
tmp = x + (y / (1.1283791670955126d0 - (x * y)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -7000000.0) {
tmp = x + (-1.0 / x);
} else if (z <= 2.5e-5) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -7000000.0: tmp = x + (-1.0 / x) elif z <= 2.5e-5: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -7000000.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 2.5e-5) tmp = Float64(x + Float64(y / Float64(1.1283791670955126 - Float64(x * y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -7000000.0) tmp = x + (-1.0 / x); elseif (z <= 2.5e-5) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -7000000.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-5], N[(x + N[(y / N[(1.1283791670955126 - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7000000:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-5}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7e6Initial program 93.9%
*-lft-identity93.9%
metadata-eval93.9%
times-frac93.9%
neg-mul-193.9%
sub0-neg93.7%
associate-+l-93.7%
neg-sub093.9%
+-commutative93.9%
sub-neg93.9%
associate-/l*94.1%
div-sub94.1%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -7e6 < z < 2.50000000000000012e-5Initial program 99.9%
Taylor expanded in z around 0 99.1%
if 2.50000000000000012e-5 < z Initial program 93.0%
*-lft-identity93.0%
metadata-eval93.0%
times-frac93.0%
neg-mul-193.0%
sub0-neg93.0%
associate-+l-93.0%
neg-sub093.0%
+-commutative93.0%
sub-neg93.0%
associate-/l*93.0%
div-sub93.0%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 50.5%
Taylor expanded in x around inf 100.0%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (if (<= z -2e-41) x (if (<= z 2.4e-5) (- x (* y -0.8862269254527579)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -2e-41) {
tmp = x;
} else if (z <= 2.4e-5) {
tmp = x - (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 (z <= (-2d-41)) then
tmp = x
else if (z <= 2.4d-5) then
tmp = x - (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 (z <= -2e-41) {
tmp = x;
} else if (z <= 2.4e-5) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2e-41: tmp = x elif z <= 2.4e-5: tmp = x - (y * -0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2e-41) tmp = x; elseif (z <= 2.4e-5) tmp = Float64(x - Float64(y * -0.8862269254527579)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2e-41) tmp = x; elseif (z <= 2.4e-5) tmp = x - (y * -0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2e-41], x, If[LessEqual[z, 2.4e-5], N[(x - N[(y * -0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-41}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-5}:\\
\;\;\;\;x - y \cdot -0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.00000000000000001e-41 or 2.4000000000000001e-5 < z Initial program 93.9%
*-lft-identity93.9%
metadata-eval93.9%
times-frac93.9%
neg-mul-193.9%
sub0-neg93.8%
associate-+l-93.8%
neg-sub093.9%
+-commutative93.9%
sub-neg93.9%
associate-/l*94.0%
div-sub94.0%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 72.5%
Taylor expanded in x around inf 72.4%
if -2.00000000000000001e-41 < z < 2.4000000000000001e-5Initial program 99.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
sub0-neg99.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
div-sub99.9%
associate-*r/99.9%
*-inverses99.9%
*-rgt-identity99.9%
associate-*l/99.9%
cancel-sign-sub-inv99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
associate-*l/99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around 0 79.2%
*-commutative79.2%
Simplified79.2%
Final simplification75.5%
(FPCore (x y z) :precision binary64 (if (<= z -1.78e-40) (+ x (/ -1.0 x)) (if (<= z 2.35e-7) (- x (* y -0.8862269254527579)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.78e-40) {
tmp = x + (-1.0 / x);
} else if (z <= 2.35e-7) {
tmp = x - (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 (z <= (-1.78d-40)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 2.35d-7) then
tmp = x - (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 (z <= -1.78e-40) {
tmp = x + (-1.0 / x);
} else if (z <= 2.35e-7) {
tmp = x - (y * -0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.78e-40: tmp = x + (-1.0 / x) elif z <= 2.35e-7: tmp = x - (y * -0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.78e-40) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 2.35e-7) tmp = Float64(x - Float64(y * -0.8862269254527579)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.78e-40) tmp = x + (-1.0 / x); elseif (z <= 2.35e-7) tmp = x - (y * -0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.78e-40], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.35e-7], N[(x - N[(y * -0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.78 \cdot 10^{-40}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-7}:\\
\;\;\;\;x - y \cdot -0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.78000000000000001e-40Initial program 94.8%
*-lft-identity94.8%
metadata-eval94.8%
times-frac94.8%
neg-mul-194.8%
sub0-neg94.6%
associate-+l-94.6%
neg-sub094.9%
+-commutative94.9%
sub-neg94.9%
associate-/l*95.0%
div-sub95.0%
associate-*r/99.9%
*-inverses99.9%
*-rgt-identity99.9%
associate-*l/99.9%
cancel-sign-sub-inv99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
associate-*l/99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Taylor expanded in x around inf 94.8%
if -1.78000000000000001e-40 < z < 2.35e-7Initial program 99.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
sub0-neg99.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
div-sub99.9%
associate-*r/99.9%
*-inverses99.9%
*-rgt-identity99.9%
associate-*l/99.9%
cancel-sign-sub-inv99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
associate-*l/99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around 0 79.2%
*-commutative79.2%
Simplified79.2%
if 2.35e-7 < z Initial program 93.0%
*-lft-identity93.0%
metadata-eval93.0%
times-frac93.0%
neg-mul-193.0%
sub0-neg93.0%
associate-+l-93.0%
neg-sub093.0%
+-commutative93.0%
sub-neg93.0%
associate-/l*93.0%
div-sub93.0%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 50.5%
Taylor expanded in x around inf 100.0%
Final simplification89.2%
(FPCore (x y z) :precision binary64 (if (<= z -1.78e-40) (+ x (/ -1.0 x)) (if (<= z 3.15e-9) (- x (/ y -1.1283791670955126)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.78e-40) {
tmp = x + (-1.0 / x);
} else if (z <= 3.15e-9) {
tmp = x - (y / -1.1283791670955126);
} 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 (z <= (-1.78d-40)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 3.15d-9) then
tmp = x - (y / (-1.1283791670955126d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.78e-40) {
tmp = x + (-1.0 / x);
} else if (z <= 3.15e-9) {
tmp = x - (y / -1.1283791670955126);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.78e-40: tmp = x + (-1.0 / x) elif z <= 3.15e-9: tmp = x - (y / -1.1283791670955126) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.78e-40) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 3.15e-9) tmp = Float64(x - Float64(y / -1.1283791670955126)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.78e-40) tmp = x + (-1.0 / x); elseif (z <= 3.15e-9) tmp = x - (y / -1.1283791670955126); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.78e-40], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.15e-9], N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.78 \cdot 10^{-40}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-9}:\\
\;\;\;\;x - \frac{y}{-1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.78000000000000001e-40Initial program 94.8%
*-lft-identity94.8%
metadata-eval94.8%
times-frac94.8%
neg-mul-194.8%
sub0-neg94.6%
associate-+l-94.6%
neg-sub094.9%
+-commutative94.9%
sub-neg94.9%
associate-/l*95.0%
div-sub95.0%
associate-*r/99.9%
*-inverses99.9%
*-rgt-identity99.9%
associate-*l/99.9%
cancel-sign-sub-inv99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
associate-*l/99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Taylor expanded in x around inf 94.8%
if -1.78000000000000001e-40 < z < 3.1500000000000001e-9Initial program 99.9%
*-lft-identity99.9%
metadata-eval99.9%
times-frac99.9%
neg-mul-199.9%
sub0-neg99.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
sub-neg99.9%
associate-/l*99.9%
div-sub99.9%
associate-*r/99.9%
*-inverses99.9%
*-rgt-identity99.9%
associate-*l/99.9%
cancel-sign-sub-inv99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
associate-*l/99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around 0 79.2%
*-commutative79.2%
Simplified79.2%
metadata-eval79.2%
div-inv79.3%
Applied egg-rr79.3%
if 3.1500000000000001e-9 < z Initial program 93.0%
*-lft-identity93.0%
metadata-eval93.0%
times-frac93.0%
neg-mul-193.0%
sub0-neg93.0%
associate-+l-93.0%
neg-sub093.0%
+-commutative93.0%
sub-neg93.0%
associate-/l*93.0%
div-sub93.0%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 50.5%
Taylor expanded in x around inf 100.0%
Final simplification89.3%
(FPCore (x y z) :precision binary64 (if (<= x -5.7e-294) x (if (<= x 2e-22) (/ (- y) -1.1283791670955126) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.7e-294) {
tmp = x;
} else if (x <= 2e-22) {
tmp = -y / -1.1283791670955126;
} 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 <= (-5.7d-294)) then
tmp = x
else if (x <= 2d-22) then
tmp = -y / (-1.1283791670955126d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.7e-294) {
tmp = x;
} else if (x <= 2e-22) {
tmp = -y / -1.1283791670955126;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.7e-294: tmp = x elif x <= 2e-22: tmp = -y / -1.1283791670955126 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.7e-294) tmp = x; elseif (x <= 2e-22) tmp = Float64(Float64(-y) / -1.1283791670955126); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.7e-294) tmp = x; elseif (x <= 2e-22) tmp = -y / -1.1283791670955126; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.7e-294], x, If[LessEqual[x, 2e-22], N[((-y) / -1.1283791670955126), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.7 \cdot 10^{-294}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-22}:\\
\;\;\;\;\frac{-y}{-1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.70000000000000032e-294 or 2.0000000000000001e-22 < x Initial program 96.7%
*-lft-identity96.7%
metadata-eval96.7%
times-frac96.7%
neg-mul-196.7%
sub0-neg96.6%
associate-+l-96.6%
neg-sub096.7%
+-commutative96.7%
sub-neg96.7%
associate-/l*96.7%
div-sub96.7%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 75.7%
Taylor expanded in x around inf 78.7%
if -5.70000000000000032e-294 < x < 2.0000000000000001e-22Initial program 96.4%
*-lft-identity96.4%
metadata-eval96.4%
times-frac96.4%
neg-mul-196.4%
sub0-neg96.2%
associate-+l-96.2%
neg-sub096.4%
+-commutative96.4%
sub-neg96.4%
associate-/l*96.4%
div-sub96.4%
associate-*r/99.8%
*-inverses99.8%
*-rgt-identity99.8%
associate-*l/99.8%
cancel-sign-sub-inv99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
associate-*l/99.8%
distribute-rgt-neg-in99.8%
Simplified99.8%
Taylor expanded in z around 0 63.3%
Taylor expanded in x around 0 53.0%
*-commutative53.0%
Simplified53.0%
Taylor expanded in x around 0 45.1%
*-commutative45.1%
Simplified45.1%
metadata-eval45.1%
metadata-eval45.1%
distribute-rgt-neg-in45.1%
div-inv45.3%
distribute-neg-frac45.3%
Applied egg-rr45.3%
Final simplification71.4%
(FPCore (x y z) :precision binary64 (if (<= x 1.02e-307) x (if (<= x 2e-22) (* y 0.8862269254527579) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= 1.02e-307) {
tmp = x;
} else if (x <= 2e-22) {
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 <= 1.02d-307) then
tmp = x
else if (x <= 2d-22) 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 <= 1.02e-307) {
tmp = x;
} else if (x <= 2e-22) {
tmp = y * 0.8862269254527579;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 1.02e-307: tmp = x elif x <= 2e-22: tmp = y * 0.8862269254527579 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= 1.02e-307) tmp = x; elseif (x <= 2e-22) tmp = Float64(y * 0.8862269254527579); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.02e-307) tmp = x; elseif (x <= 2e-22) tmp = y * 0.8862269254527579; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 1.02e-307], x, If[LessEqual[x, 2e-22], N[(y * 0.8862269254527579), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.02 \cdot 10^{-307}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-22}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < 1.02000000000000005e-307 or 2.0000000000000001e-22 < x Initial program 96.7%
*-lft-identity96.7%
metadata-eval96.7%
times-frac96.7%
neg-mul-196.7%
sub0-neg96.7%
associate-+l-96.7%
neg-sub096.7%
+-commutative96.7%
sub-neg96.7%
associate-/l*96.7%
div-sub96.7%
associate-*r/100.0%
*-inverses100.0%
*-rgt-identity100.0%
associate-*l/100.0%
cancel-sign-sub-inv100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around inf 75.1%
Taylor expanded in x around inf 78.1%
if 1.02000000000000005e-307 < x < 2.0000000000000001e-22Initial program 96.2%
*-lft-identity96.2%
metadata-eval96.2%
times-frac96.2%
neg-mul-196.2%
sub0-neg96.0%
associate-+l-96.0%
neg-sub096.2%
+-commutative96.2%
sub-neg96.2%
associate-/l*96.2%
div-sub96.2%
associate-*r/99.8%
*-inverses99.8%
*-rgt-identity99.8%
associate-*l/99.8%
cancel-sign-sub-inv99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
associate-*l/99.8%
distribute-rgt-neg-in99.8%
Simplified99.8%
Taylor expanded in z around 0 64.9%
Taylor expanded in x around 0 54.0%
*-commutative54.0%
Simplified54.0%
Taylor expanded in x around 0 45.7%
*-commutative45.7%
Simplified45.7%
Final simplification71.4%
(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 96.6%
*-lft-identity96.6%
metadata-eval96.6%
times-frac96.6%
neg-mul-196.6%
sub0-neg96.5%
associate-+l-96.5%
neg-sub096.6%
+-commutative96.6%
sub-neg96.6%
associate-/l*96.6%
div-sub96.6%
associate-*r/99.9%
*-inverses99.9%
*-rgt-identity99.9%
associate-*l/99.9%
cancel-sign-sub-inv99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
associate-*l/99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Taylor expanded in x around inf 66.1%
Taylor expanded in x around inf 67.1%
Final simplification67.1%
(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 2023230
(FPCore (x y z)
:name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))
(+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))