
(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 10 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 (<= (exp z) 0.0)
(+ x (/ -1.0 x))
(if (<= (exp z) 2.0)
(+ x (/ y (- (+ 1.1283791670955126 (* z 1.1283791670955126)) (* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (exp(z) <= 2.0) {
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 (exp(z) <= 0.0d0) then
tmp = x + ((-1.0d0) / x)
else if (exp(z) <= 2.0d0) 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 (Math.exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else if (Math.exp(z) <= 2.0) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / x) elif math.exp(z) <= 2.0: tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (exp(z) <= 2.0) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + 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 (exp(z) <= 0.0) tmp = x + (-1.0 / x); elseif (exp(z) <= 2.0) tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 0.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Exp[z], $MachinePrecision], 2.0], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * 1.1283791670955126), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;e^{z} \leq 2:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 87.8%
*-lft-identity87.8%
metadata-eval87.8%
times-frac87.8%
neg-mul-187.8%
sub0-neg87.8%
associate-+l-87.8%
neg-sub088.1%
+-commutative88.1%
sub-neg88.1%
associate-/l*88.4%
div-sub88.4%
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 y around inf 100.0%
if 0.0 < (exp.f64 z) < 2Initial program 99.9%
Taylor expanded in z around 0 99.9%
if 2 < (exp.f64 z) Initial program 94.5%
*-lft-identity94.5%
metadata-eval94.5%
times-frac94.5%
neg-mul-194.5%
sub0-neg94.5%
associate-+l-94.5%
neg-sub094.5%
+-commutative94.5%
sub-neg94.5%
associate-/l*94.5%
div-sub94.5%
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 z around 0 60.7%
associate-*r/60.7%
metadata-eval60.7%
Simplified60.7%
Taylor expanded in y around 0 51.6%
Taylor expanded in y around 0 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 5e+261) 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+261) {
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+261) 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+261) {
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+261: 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+261) 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+261) 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+261], 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^{+261}:\\
\;\;\;\;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)))) < 5.0000000000000001e261Initial program 98.8%
if 5.0000000000000001e261 < (+.f64 x (/.f64 y (-.f64 (*.f64 5641895835477563/5000000000000000 (exp.f64 z)) (*.f64 x y)))) Initial program 62.1%
*-lft-identity62.1%
metadata-eval62.1%
times-frac62.1%
neg-mul-162.1%
sub0-neg62.6%
associate-+l-62.6%
neg-sub062.9%
+-commutative62.9%
sub-neg62.9%
associate-/l*63.0%
div-sub63.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 y around inf 100.0%
Final simplification98.9%
(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 95.8%
*-lft-identity95.8%
metadata-eval95.8%
times-frac95.8%
neg-mul-195.8%
sub0-neg95.8%
associate-+l-95.8%
neg-sub095.8%
+-commutative95.8%
sub-neg95.8%
associate-/l*95.9%
div-sub95.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%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= z -3.1e+15) (+ x (/ -1.0 x)) (if (<= z 13.0) (+ x (/ -1.0 (- x (/ 1.1283791670955126 y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.1e+15) {
tmp = x + (-1.0 / x);
} else if (z <= 13.0) {
tmp = x + (-1.0 / (x - (1.1283791670955126 / 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 <= (-3.1d+15)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 13.0d0) then
tmp = x + ((-1.0d0) / (x - (1.1283791670955126d0 / y)))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.1e+15) {
tmp = x + (-1.0 / x);
} else if (z <= 13.0) {
tmp = x + (-1.0 / (x - (1.1283791670955126 / y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.1e+15: tmp = x + (-1.0 / x) elif z <= 13.0: tmp = x + (-1.0 / (x - (1.1283791670955126 / y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.1e+15) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 13.0) tmp = Float64(x + Float64(-1.0 / Float64(x - Float64(1.1283791670955126 / y)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.1e+15) tmp = x + (-1.0 / x); elseif (z <= 13.0) tmp = x + (-1.0 / (x - (1.1283791670955126 / y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.1e+15], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 13.0], N[(x + N[(-1.0 / N[(x - N[(1.1283791670955126 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+15}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 13:\\
\;\;\;\;x + \frac{-1}{x - \frac{1.1283791670955126}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.1e15Initial program 87.3%
*-lft-identity87.3%
metadata-eval87.3%
times-frac87.3%
neg-mul-187.3%
sub0-neg87.3%
associate-+l-87.3%
neg-sub087.7%
+-commutative87.7%
sub-neg87.7%
associate-/l*87.9%
div-sub87.9%
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 y around inf 100.0%
if -3.1e15 < z < 13Initial 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.6%
associate-*r/99.6%
metadata-eval99.6%
Simplified99.6%
if 13 < z Initial program 94.5%
*-lft-identity94.5%
metadata-eval94.5%
times-frac94.5%
neg-mul-194.5%
sub0-neg94.5%
associate-+l-94.5%
neg-sub094.5%
+-commutative94.5%
sub-neg94.5%
associate-/l*94.5%
div-sub94.5%
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 z around 0 60.7%
associate-*r/60.7%
metadata-eval60.7%
Simplified60.7%
Taylor expanded in y around 0 51.6%
Taylor expanded in y around 0 100.0%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= z -3.1e+15) (+ x (/ -1.0 x)) (if (<= z 13.0) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.1e+15) {
tmp = x + (-1.0 / x);
} else if (z <= 13.0) {
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 <= (-3.1d+15)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 13.0d0) 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 <= -3.1e+15) {
tmp = x + (-1.0 / x);
} else if (z <= 13.0) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.1e+15: tmp = x + (-1.0 / x) elif z <= 13.0: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.1e+15) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 13.0) 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 <= -3.1e+15) tmp = x + (-1.0 / x); elseif (z <= 13.0) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.1e+15], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 13.0], 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 -3.1 \cdot 10^{+15}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 13:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.1e15Initial program 87.3%
*-lft-identity87.3%
metadata-eval87.3%
times-frac87.3%
neg-mul-187.3%
sub0-neg87.3%
associate-+l-87.3%
neg-sub087.7%
+-commutative87.7%
sub-neg87.7%
associate-/l*87.9%
div-sub87.9%
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 y around inf 100.0%
if -3.1e15 < z < 13Initial program 99.9%
Taylor expanded in z around 0 99.7%
if 13 < z Initial program 94.5%
*-lft-identity94.5%
metadata-eval94.5%
times-frac94.5%
neg-mul-194.5%
sub0-neg94.5%
associate-+l-94.5%
neg-sub094.5%
+-commutative94.5%
sub-neg94.5%
associate-/l*94.5%
div-sub94.5%
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 z around 0 60.7%
associate-*r/60.7%
metadata-eval60.7%
Simplified60.7%
Taylor expanded in y around 0 51.6%
Taylor expanded in y around 0 100.0%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.55e-41) (and (not (<= z -2.1e-195)) (<= z 1.15e-208))) (+ x (/ -1.0 x)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.55e-41) || (!(z <= -2.1e-195) && (z <= 1.15e-208))) {
tmp = x + (-1.0 / x);
} 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.55d-41)) .or. (.not. (z <= (-2.1d-195))) .and. (z <= 1.15d-208)) then
tmp = x + ((-1.0d0) / x)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.55e-41) || (!(z <= -2.1e-195) && (z <= 1.15e-208))) {
tmp = x + (-1.0 / x);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.55e-41) or (not (z <= -2.1e-195) and (z <= 1.15e-208)): tmp = x + (-1.0 / x) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.55e-41) || (!(z <= -2.1e-195) && (z <= 1.15e-208))) tmp = Float64(x + Float64(-1.0 / x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.55e-41) || (~((z <= -2.1e-195)) && (z <= 1.15e-208))) tmp = x + (-1.0 / x); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.55e-41], And[N[Not[LessEqual[z, -2.1e-195]], $MachinePrecision], LessEqual[z, 1.15e-208]]], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-41} \lor \neg \left(z \leq -2.1 \cdot 10^{-195}\right) \land z \leq 1.15 \cdot 10^{-208}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.55e-41 or -2.1e-195 < z < 1.14999999999999998e-208Initial program 93.4%
*-lft-identity93.4%
metadata-eval93.4%
times-frac93.4%
neg-mul-193.4%
sub0-neg93.4%
associate-+l-93.4%
neg-sub093.6%
+-commutative93.6%
sub-neg93.6%
associate-/l*93.7%
div-sub93.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 y around inf 84.8%
if -1.55e-41 < z < -2.1e-195 or 1.14999999999999998e-208 < z Initial program 97.4%
*-lft-identity97.4%
metadata-eval97.4%
times-frac97.4%
neg-mul-197.4%
sub0-neg97.4%
associate-+l-97.4%
neg-sub097.4%
+-commutative97.4%
sub-neg97.4%
associate-/l*97.3%
div-sub97.3%
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 81.3%
associate-*r/81.3%
metadata-eval81.3%
Simplified81.3%
Taylor expanded in y around 0 63.3%
Taylor expanded in y around 0 80.8%
Final simplification82.4%
(FPCore (x y z) :precision binary64 (if (<= z -3.1e-172) (+ x (/ -1.0 x)) (if (<= z 1.05e-29) (+ x (/ y 1.1283791670955126)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.1e-172) {
tmp = x + (-1.0 / x);
} else if (z <= 1.05e-29) {
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 <= (-3.1d-172)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 1.05d-29) 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 <= -3.1e-172) {
tmp = x + (-1.0 / x);
} else if (z <= 1.05e-29) {
tmp = x + (y / 1.1283791670955126);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.1e-172: tmp = x + (-1.0 / x) elif z <= 1.05e-29: tmp = x + (y / 1.1283791670955126) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.1e-172) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 1.05e-29) 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 <= -3.1e-172) tmp = x + (-1.0 / x); elseif (z <= 1.05e-29) tmp = x + (y / 1.1283791670955126); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.1e-172], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-29], N[(x + N[(y / 1.1283791670955126), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-172}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-29}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.1000000000000003e-172Initial program 92.7%
*-lft-identity92.7%
metadata-eval92.7%
times-frac92.7%
neg-mul-192.7%
sub0-neg92.7%
associate-+l-92.7%
neg-sub092.9%
+-commutative92.9%
sub-neg92.9%
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 y around inf 89.4%
if -3.1000000000000003e-172 < z < 1.04999999999999995e-29Initial program 99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 77.4%
if 1.04999999999999995e-29 < z Initial program 95.2%
*-lft-identity95.2%
metadata-eval95.2%
times-frac95.2%
neg-mul-195.2%
sub0-neg95.2%
associate-+l-95.2%
neg-sub095.2%
+-commutative95.2%
sub-neg95.2%
associate-/l*95.2%
div-sub95.2%
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 z around 0 65.4%
associate-*r/65.4%
metadata-eval65.4%
Simplified65.4%
Taylor expanded in y around 0 50.5%
Taylor expanded in y around 0 94.1%
Final simplification87.1%
(FPCore (x y z) :precision binary64 (if (<= x -4.2e-184) x (if (<= x 2.65e-188) (* y 0.8862269254527579) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -4.2e-184) {
tmp = x;
} else if (x <= 2.65e-188) {
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 <= (-4.2d-184)) then
tmp = x
else if (x <= 2.65d-188) 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 <= -4.2e-184) {
tmp = x;
} else if (x <= 2.65e-188) {
tmp = y * 0.8862269254527579;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -4.2e-184: tmp = x elif x <= 2.65e-188: tmp = y * 0.8862269254527579 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -4.2e-184) tmp = x; elseif (x <= 2.65e-188) tmp = Float64(y * 0.8862269254527579); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -4.2e-184) tmp = x; elseif (x <= 2.65e-188) tmp = y * 0.8862269254527579; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -4.2e-184], x, If[LessEqual[x, 2.65e-188], N[(y * 0.8862269254527579), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-184}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.65 \cdot 10^{-188}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.1999999999999998e-184 or 2.65000000000000007e-188 < x Initial program 96.7%
*-lft-identity96.7%
metadata-eval96.7%
times-frac96.7%
neg-mul-196.7%
sub0-neg96.8%
associate-+l-96.8%
neg-sub096.8%
+-commutative96.8%
sub-neg96.8%
associate-/l*96.8%
div-sub96.8%
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 z around 0 88.0%
associate-*r/88.0%
metadata-eval88.0%
Simplified88.0%
Taylor expanded in y around 0 57.2%
Taylor expanded in y around 0 78.0%
if -4.1999999999999998e-184 < x < 2.65000000000000007e-188Initial program 92.7%
*-lft-identity92.7%
metadata-eval92.7%
times-frac92.7%
neg-mul-192.7%
sub0-neg92.6%
associate-+l-92.6%
neg-sub092.9%
+-commutative92.9%
sub-neg92.9%
associate-/l*93.0%
div-sub93.0%
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 52.4%
associate-*r/52.4%
metadata-eval52.4%
Simplified52.4%
Taylor expanded in y around 0 43.3%
Taylor expanded in y around inf 41.5%
*-commutative41.5%
Simplified41.5%
Final simplification69.1%
(FPCore (x y z) :precision binary64 (if (<= x -1.4e-183) x (if (<= x 1.35e-191) (/ y 1.1283791670955126) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.4e-183) {
tmp = x;
} else if (x <= 1.35e-191) {
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 <= (-1.4d-183)) then
tmp = x
else if (x <= 1.35d-191) 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 <= -1.4e-183) {
tmp = x;
} else if (x <= 1.35e-191) {
tmp = y / 1.1283791670955126;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.4e-183: tmp = x elif x <= 1.35e-191: tmp = y / 1.1283791670955126 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.4e-183) tmp = x; elseif (x <= 1.35e-191) tmp = Float64(y / 1.1283791670955126); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.4e-183) tmp = x; elseif (x <= 1.35e-191) tmp = y / 1.1283791670955126; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.4e-183], x, If[LessEqual[x, 1.35e-191], N[(y / 1.1283791670955126), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-183}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-191}:\\
\;\;\;\;\frac{y}{1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.39999999999999992e-183 or 1.34999999999999999e-191 < x Initial program 96.7%
*-lft-identity96.7%
metadata-eval96.7%
times-frac96.7%
neg-mul-196.7%
sub0-neg96.8%
associate-+l-96.8%
neg-sub096.8%
+-commutative96.8%
sub-neg96.8%
associate-/l*96.8%
div-sub96.8%
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 z around 0 88.0%
associate-*r/88.0%
metadata-eval88.0%
Simplified88.0%
Taylor expanded in y around 0 57.2%
Taylor expanded in y around 0 78.0%
if -1.39999999999999992e-183 < x < 1.34999999999999999e-191Initial program 92.7%
Taylor expanded in z around 0 52.5%
div-inv52.4%
add-sqr-sqrt34.3%
sqrt-unprod21.8%
sqr-neg21.8%
sqrt-unprod2.3%
add-sqr-sqrt3.4%
cancel-sign-sub-inv3.4%
div-inv3.4%
cancel-sign-sub-inv3.4%
add-sqr-sqrt2.3%
sqrt-unprod16.1%
sqr-neg16.1%
sqrt-unprod7.4%
add-sqr-sqrt12.7%
Applied egg-rr12.7%
Taylor expanded in x around 0 2.7%
*-commutative2.7%
Simplified2.7%
add-sqr-sqrt1.5%
sqrt-unprod20.7%
swap-sqr20.7%
metadata-eval20.7%
metadata-eval20.7%
swap-sqr20.7%
metadata-eval20.7%
div-inv20.7%
metadata-eval20.7%
div-inv20.7%
sqrt-unprod27.8%
add-sqr-sqrt41.6%
Applied egg-rr41.6%
Final simplification69.1%
(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 95.8%
*-lft-identity95.8%
metadata-eval95.8%
times-frac95.8%
neg-mul-195.8%
sub0-neg95.8%
associate-+l-95.8%
neg-sub095.8%
+-commutative95.8%
sub-neg95.8%
associate-/l*95.9%
div-sub95.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 79.4%
associate-*r/79.4%
metadata-eval79.4%
Simplified79.4%
Taylor expanded in y around 0 53.8%
Taylor expanded in y around 0 65.4%
Final simplification65.4%
(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 2023238
(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)))))