
(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 8 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) 1.00005) (+ x (/ 1.0 (- (/ 1.1283791670955126 y) x))) 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) <= 1.00005) {
tmp = x + (1.0 / ((1.1283791670955126 / y) - 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 (exp(z) <= 0.0d0) then
tmp = x - (1.0d0 / x)
else if (exp(z) <= 1.00005d0) then
tmp = x + (1.0d0 / ((1.1283791670955126d0 / y) - x))
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) <= 1.00005) {
tmp = x + (1.0 / ((1.1283791670955126 / y) - x));
} 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) <= 1.00005: tmp = x + (1.0 / ((1.1283791670955126 / y) - x)) 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) <= 1.00005) tmp = Float64(x + Float64(1.0 / Float64(Float64(1.1283791670955126 / y) - x))); 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) <= 1.00005) tmp = x + (1.0 / ((1.1283791670955126 / y) - x)); 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], 1.00005], N[(x + N[(1.0 / N[(N[(1.1283791670955126 / y), $MachinePrecision] - x), $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 1.00005:\\
\;\;\;\;x + \frac{1}{\frac{1.1283791670955126}{y} - x}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 91.2%
remove-double-neg91.2%
distribute-frac-neg91.2%
unsub-neg91.2%
distribute-frac-neg91.2%
distribute-neg-frac291.2%
neg-sub091.0%
associate--r-91.0%
neg-sub091.4%
+-commutative91.4%
fma-define91.4%
*-commutative91.4%
distribute-rgt-neg-in91.4%
metadata-eval91.4%
Simplified91.4%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) < 1.00005000000000011Initial program 99.9%
remove-double-neg99.9%
distribute-frac-neg99.9%
unsub-neg99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
clear-num99.9%
inv-pow99.9%
*-commutative99.9%
fma-neg99.9%
metadata-eval99.9%
Applied egg-rr99.9%
unpow-199.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
if 1.00005000000000011 < (exp.f64 z) Initial program 98.3%
remove-double-neg98.3%
distribute-frac-neg98.3%
unsub-neg98.3%
distribute-frac-neg98.3%
distribute-neg-frac298.3%
neg-sub098.3%
associate--r-98.3%
neg-sub098.3%
+-commutative98.3%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 45.9%
Taylor expanded in x around inf 100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 (if (<= (exp z) 0.0) (- x (/ 1.0 x)) (- x (/ y (* x (- y (* (exp z) (/ 1.1283791670955126 x))))))))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x - (1.0 / x);
} else {
tmp = x - (y / (x * (y - (exp(z) * (1.1283791670955126 / 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
tmp = x - (y / (x * (y - (exp(z) * (1.1283791670955126d0 / 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 {
tmp = x - (y / (x * (y - (Math.exp(z) * (1.1283791670955126 / x)))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x - (1.0 / x) else: tmp = x - (y / (x * (y - (math.exp(z) * (1.1283791670955126 / x))))) return tmp
function code(x, y, z) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x - Float64(1.0 / x)); else tmp = Float64(x - Float64(y / Float64(x * Float64(y - Float64(exp(z) * Float64(1.1283791670955126 / 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); else tmp = x - (y / (x * (y - (exp(z) * (1.1283791670955126 / 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], N[(x - N[(y / N[(x * N[(y - N[(N[Exp[z], $MachinePrecision] * N[(1.1283791670955126 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{x \cdot \left(y - e^{z} \cdot \frac{1.1283791670955126}{x}\right)}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 91.2%
remove-double-neg91.2%
distribute-frac-neg91.2%
unsub-neg91.2%
distribute-frac-neg91.2%
distribute-neg-frac291.2%
neg-sub091.0%
associate--r-91.0%
neg-sub091.4%
+-commutative91.4%
fma-define91.4%
*-commutative91.4%
distribute-rgt-neg-in91.4%
metadata-eval91.4%
Simplified91.4%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) Initial program 99.4%
Taylor expanded in x around inf 99.9%
associate-*r/99.9%
*-commutative99.9%
associate-/l*99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= (exp z) 0.0) (- x (/ 1.0 x)) (- x (/ y (- (* x y) (* (exp z) 1.1283791670955126))))))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x - (1.0 / x);
} else {
tmp = x - (y / ((x * y) - (exp(z) * 1.1283791670955126)));
}
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
tmp = x - (y / ((x * y) - (exp(z) * 1.1283791670955126d0)))
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 {
tmp = x - (y / ((x * y) - (Math.exp(z) * 1.1283791670955126)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x - (1.0 / x) else: tmp = x - (y / ((x * y) - (math.exp(z) * 1.1283791670955126))) return tmp
function code(x, y, z) tmp = 0.0 if (exp(z) <= 0.0) tmp = Float64(x - Float64(1.0 / x)); else tmp = Float64(x - Float64(y / Float64(Float64(x * y) - Float64(exp(z) * 1.1283791670955126)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (exp(z) <= 0.0) tmp = x - (1.0 / x); else tmp = x - (y / ((x * y) - (exp(z) * 1.1283791670955126))); 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], N[(x - N[(y / N[(N[(x * y), $MachinePrecision] - N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{x \cdot y - e^{z} \cdot 1.1283791670955126}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 91.2%
remove-double-neg91.2%
distribute-frac-neg91.2%
unsub-neg91.2%
distribute-frac-neg91.2%
distribute-neg-frac291.2%
neg-sub091.0%
associate--r-91.0%
neg-sub091.4%
+-commutative91.4%
fma-define91.4%
*-commutative91.4%
distribute-rgt-neg-in91.4%
metadata-eval91.4%
Simplified91.4%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) Initial program 99.4%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (<= z -1.36e-19) (- x (/ 1.0 x)) (if (<= z 7.4e-221) (- x (/ y -1.1283791670955126)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.36e-19) {
tmp = x - (1.0 / x);
} else if (z <= 7.4e-221) {
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.36d-19)) then
tmp = x - (1.0d0 / x)
else if (z <= 7.4d-221) 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.36e-19) {
tmp = x - (1.0 / x);
} else if (z <= 7.4e-221) {
tmp = x - (y / -1.1283791670955126);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.36e-19: tmp = x - (1.0 / x) elif z <= 7.4e-221: tmp = x - (y / -1.1283791670955126) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.36e-19) tmp = Float64(x - Float64(1.0 / x)); elseif (z <= 7.4e-221) 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.36e-19) tmp = x - (1.0 / x); elseif (z <= 7.4e-221) tmp = x - (y / -1.1283791670955126); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.36e-19], N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.4e-221], N[(x - N[(y / -1.1283791670955126), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.36 \cdot 10^{-19}:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-221}:\\
\;\;\;\;x - \frac{y}{-1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.3599999999999999e-19Initial program 91.6%
remove-double-neg91.6%
distribute-frac-neg91.6%
unsub-neg91.6%
distribute-frac-neg91.6%
distribute-neg-frac291.6%
neg-sub091.5%
associate--r-91.5%
neg-sub091.8%
+-commutative91.8%
fma-define91.8%
*-commutative91.8%
distribute-rgt-neg-in91.8%
metadata-eval91.8%
Simplified91.8%
Taylor expanded in y around inf 100.0%
if -1.3599999999999999e-19 < z < 7.39999999999999971e-221Initial program 99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
unsub-neg99.8%
distribute-frac-neg99.8%
distribute-neg-frac299.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
fma-define99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 78.4%
if 7.39999999999999971e-221 < z Initial program 99.0%
remove-double-neg99.0%
distribute-frac-neg99.0%
unsub-neg99.0%
distribute-frac-neg99.0%
distribute-neg-frac299.0%
neg-sub099.0%
associate--r-99.0%
neg-sub099.0%
+-commutative99.0%
fma-define100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 61.4%
Taylor expanded in x around inf 90.0%
(FPCore (x y z) :precision binary64 (if (<= z -4.4e-26) (- x (/ 1.0 x)) (if (<= z -2.1e-36) (/ y 1.1283791670955126) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.4e-26) {
tmp = x - (1.0 / x);
} else if (z <= -2.1e-36) {
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 (z <= (-4.4d-26)) then
tmp = x - (1.0d0 / x)
else if (z <= (-2.1d-36)) 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 (z <= -4.4e-26) {
tmp = x - (1.0 / x);
} else if (z <= -2.1e-36) {
tmp = y / 1.1283791670955126;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.4e-26: tmp = x - (1.0 / x) elif z <= -2.1e-36: tmp = y / 1.1283791670955126 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.4e-26) tmp = Float64(x - Float64(1.0 / x)); elseif (z <= -2.1e-36) tmp = Float64(y / 1.1283791670955126); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.4e-26) tmp = x - (1.0 / x); elseif (z <= -2.1e-36) tmp = y / 1.1283791670955126; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.4e-26], N[(x - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e-36], N[(y / 1.1283791670955126), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-26}:\\
\;\;\;\;x - \frac{1}{x}\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-36}:\\
\;\;\;\;\frac{y}{1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.4000000000000002e-26Initial program 91.6%
remove-double-neg91.6%
distribute-frac-neg91.6%
unsub-neg91.6%
distribute-frac-neg91.6%
distribute-neg-frac291.6%
neg-sub091.5%
associate--r-91.5%
neg-sub091.8%
+-commutative91.8%
fma-define91.8%
*-commutative91.8%
distribute-rgt-neg-in91.8%
metadata-eval91.8%
Simplified91.8%
Taylor expanded in y around inf 100.0%
if -4.4000000000000002e-26 < z < -2.09999999999999991e-36Initial program 99.6%
remove-double-neg99.6%
distribute-frac-neg99.6%
unsub-neg99.6%
distribute-frac-neg99.6%
distribute-neg-frac299.6%
neg-sub099.6%
associate--r-99.6%
neg-sub099.6%
+-commutative99.6%
fma-define99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around 0 81.7%
*-commutative81.7%
metadata-eval81.7%
metadata-eval82.1%
distribute-rgt-neg-in82.1%
div-inv82.1%
distribute-neg-frac282.1%
metadata-eval82.1%
Applied egg-rr82.1%
if -2.09999999999999991e-36 < z Initial program 99.4%
remove-double-neg99.4%
distribute-frac-neg99.4%
unsub-neg99.4%
distribute-frac-neg99.4%
distribute-neg-frac299.4%
neg-sub099.4%
associate--r-99.4%
neg-sub099.4%
+-commutative99.4%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 61.2%
Taylor expanded in x around inf 78.6%
(FPCore (x y z) :precision binary64 (if (<= x -2.2e-196) x (if (<= x 1e-289) (/ y 1.1283791670955126) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.2e-196) {
tmp = x;
} else if (x <= 1e-289) {
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 <= (-2.2d-196)) then
tmp = x
else if (x <= 1d-289) 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 <= -2.2e-196) {
tmp = x;
} else if (x <= 1e-289) {
tmp = y / 1.1283791670955126;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.2e-196: tmp = x elif x <= 1e-289: tmp = y / 1.1283791670955126 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.2e-196) tmp = x; elseif (x <= 1e-289) tmp = Float64(y / 1.1283791670955126); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.2e-196) tmp = x; elseif (x <= 1e-289) tmp = y / 1.1283791670955126; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.2e-196], x, If[LessEqual[x, 1e-289], N[(y / 1.1283791670955126), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-196}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 10^{-289}:\\
\;\;\;\;\frac{y}{1.1283791670955126}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.20000000000000015e-196 or 1e-289 < x Initial program 98.9%
remove-double-neg98.9%
distribute-frac-neg98.9%
unsub-neg98.9%
distribute-frac-neg98.9%
distribute-neg-frac298.9%
neg-sub098.9%
associate--r-98.9%
neg-sub098.9%
+-commutative98.9%
fma-define99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 73.3%
Taylor expanded in x around inf 76.1%
if -2.20000000000000015e-196 < x < 1e-289Initial program 86.4%
remove-double-neg86.4%
distribute-frac-neg86.4%
unsub-neg86.4%
distribute-frac-neg86.4%
distribute-neg-frac286.4%
neg-sub085.9%
associate--r-85.9%
neg-sub086.6%
+-commutative86.6%
fma-define86.6%
*-commutative86.6%
distribute-rgt-neg-in86.6%
metadata-eval86.6%
Simplified86.6%
Taylor expanded in z around 0 58.1%
Taylor expanded in x around 0 49.8%
*-commutative49.8%
metadata-eval49.8%
metadata-eval50.2%
distribute-rgt-neg-in50.2%
div-inv50.2%
distribute-neg-frac250.2%
metadata-eval50.2%
Applied egg-rr50.2%
(FPCore (x y z) :precision binary64 (if (<= x -1.15e-197) x (if (<= x 1e-289) (* y 0.8862269254527579) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.15e-197) {
tmp = x;
} else if (x <= 1e-289) {
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.15d-197)) then
tmp = x
else if (x <= 1d-289) 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.15e-197) {
tmp = x;
} else if (x <= 1e-289) {
tmp = y * 0.8862269254527579;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.15e-197: tmp = x elif x <= 1e-289: tmp = y * 0.8862269254527579 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.15e-197) tmp = x; elseif (x <= 1e-289) 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.15e-197) tmp = x; elseif (x <= 1e-289) tmp = y * 0.8862269254527579; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.15e-197], x, If[LessEqual[x, 1e-289], N[(y * 0.8862269254527579), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-197}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 10^{-289}:\\
\;\;\;\;y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.15e-197 or 1e-289 < x Initial program 98.9%
remove-double-neg98.9%
distribute-frac-neg98.9%
unsub-neg98.9%
distribute-frac-neg98.9%
distribute-neg-frac298.9%
neg-sub098.9%
associate--r-98.9%
neg-sub098.9%
+-commutative98.9%
fma-define99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 73.3%
Taylor expanded in x around inf 76.1%
if -1.15e-197 < x < 1e-289Initial program 86.4%
remove-double-neg86.4%
distribute-frac-neg86.4%
unsub-neg86.4%
distribute-frac-neg86.4%
distribute-neg-frac286.4%
neg-sub085.9%
associate--r-85.9%
neg-sub086.6%
+-commutative86.6%
fma-define86.6%
*-commutative86.6%
distribute-rgt-neg-in86.6%
metadata-eval86.6%
Simplified86.6%
Taylor expanded in z around 0 58.1%
Taylor expanded in x around 0 49.8%
Final simplification73.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.5%
remove-double-neg97.5%
distribute-frac-neg97.5%
unsub-neg97.5%
distribute-frac-neg97.5%
distribute-neg-frac297.5%
neg-sub097.5%
associate--r-97.5%
neg-sub097.6%
+-commutative97.6%
fma-define98.0%
*-commutative98.0%
distribute-rgt-neg-in98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in y around inf 68.9%
Taylor expanded in x around inf 69.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 2024106
(FPCore (x y z)
:name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
:precision binary64
:alt
(+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))
(+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))