
(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 9 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.00000002)
(+ x (/ y (- (+ 1.1283791670955126 (* z 1.1283791670955126)) (* 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 if (exp(z) <= 1.00000002) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
} else {
tmp = 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 if (exp(z) <= 1.00000002d0) then
tmp = x + (y / ((1.1283791670955126d0 + (z * 1.1283791670955126d0)) - (x * y)))
else
tmp = 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 if (Math.exp(z) <= 1.00000002) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
} else {
tmp = 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) elif math.exp(z) <= 1.00000002: tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y))) else: tmp = 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)); elseif (exp(z) <= 1.00000002) tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 + Float64(z * 1.1283791670955126)) - Float64(x * y)))); else tmp = Float64(x + Float64(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); elseif (exp(z) <= 1.00000002) tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y))); else tmp = 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], If[LessEqual[N[Exp[z], $MachinePrecision], 1.00000002], N[(x + N[(y / N[(N[(1.1283791670955126 + N[(z * 1.1283791670955126), $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 0:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;e^{z} \leq 1.00000002:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{e^{z} \cdot 1.1283791670955126}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 89.7%
remove-double-neg89.7%
neg-mul-189.7%
associate-/l*89.9%
neg-mul-189.9%
associate-/r*89.9%
div-sub90.3%
metadata-eval90.3%
associate-/l*90.3%
*-commutative90.3%
neg-mul-190.3%
distribute-lft-neg-out90.3%
/-rgt-identity90.3%
div-sub90.0%
associate-/r*90.0%
neg-mul-190.0%
*-rgt-identity90.0%
times-frac90.0%
/-rgt-identity90.0%
*-commutative90.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) < 1.0000000200000001Initial program 99.9%
Taylor expanded in z around 0 99.9%
if 1.0000000200000001 < (exp.f64 z) Initial program 93.5%
Taylor expanded in x around 0 100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= (exp z) 0.0) (+ x (/ -1.0 x)) (+ x (/ y (- (* (exp z) 1.1283791670955126) (* x y))))))
double code(double x, double y, double z) {
double tmp;
if (exp(z) <= 0.0) {
tmp = x + (-1.0 / x);
} else {
tmp = x + (y / ((exp(z) * 1.1283791670955126) - (x * y)));
}
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 / ((exp(z) * 1.1283791670955126d0) - (x * y)))
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 / ((Math.exp(z) * 1.1283791670955126) - (x * y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if math.exp(z) <= 0.0: tmp = x + (-1.0 / x) else: tmp = x + (y / ((math.exp(z) * 1.1283791670955126) - (x * y))) 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(exp(z) * 1.1283791670955126) - Float64(x * y)))); 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 / ((exp(z) * 1.1283791670955126) - (x * y))); 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[(N[Exp[z], $MachinePrecision] * 1.1283791670955126), $MachinePrecision] - N[(x * y), $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}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
\end{array}
\end{array}
if (exp.f64 z) < 0.0Initial program 89.7%
remove-double-neg89.7%
neg-mul-189.7%
associate-/l*89.9%
neg-mul-189.9%
associate-/r*89.9%
div-sub90.3%
metadata-eval90.3%
associate-/l*90.3%
*-commutative90.3%
neg-mul-190.3%
distribute-lft-neg-out90.3%
/-rgt-identity90.3%
div-sub90.0%
associate-/r*90.0%
neg-mul-190.0%
*-rgt-identity90.0%
times-frac90.0%
/-rgt-identity90.0%
*-commutative90.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
if 0.0 < (exp.f64 z) Initial program 97.8%
Final simplification98.4%
(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.6%
remove-double-neg95.6%
neg-mul-195.6%
associate-/l*95.7%
neg-mul-195.7%
associate-/r*95.7%
div-sub95.8%
metadata-eval95.8%
associate-/l*95.8%
*-commutative95.8%
neg-mul-195.8%
distribute-lft-neg-out95.8%
/-rgt-identity95.8%
div-sub95.7%
associate-/r*95.7%
neg-mul-195.7%
*-rgt-identity95.7%
times-frac95.7%
/-rgt-identity95.7%
*-commutative95.7%
associate-*r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= z -170.0)
(+ x (/ -1.0 x))
(if (<= z 4e-6)
(+ x (/ y (- (+ 1.1283791670955126 (* z 1.1283791670955126)) (* x y))))
x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -170.0) {
tmp = x + (-1.0 / x);
} else if (z <= 4e-6) {
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 <= (-170.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 4d-6) 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 <= -170.0) {
tmp = x + (-1.0 / x);
} else if (z <= 4e-6) {
tmp = x + (y / ((1.1283791670955126 + (z * 1.1283791670955126)) - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -170.0: tmp = x + (-1.0 / x) elif z <= 4e-6: 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 <= -170.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 4e-6) 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 (z <= -170.0) tmp = x + (-1.0 / x); elseif (z <= 4e-6) 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, -170.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-6], 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}\;z \leq -170:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x + \frac{y}{\left(1.1283791670955126 + z \cdot 1.1283791670955126\right) - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -170Initial program 89.7%
remove-double-neg89.7%
neg-mul-189.7%
associate-/l*89.9%
neg-mul-189.9%
associate-/r*89.9%
div-sub90.3%
metadata-eval90.3%
associate-/l*90.3%
*-commutative90.3%
neg-mul-190.3%
distribute-lft-neg-out90.3%
/-rgt-identity90.3%
div-sub90.0%
associate-/r*90.0%
neg-mul-190.0%
*-rgt-identity90.0%
times-frac90.0%
/-rgt-identity90.0%
*-commutative90.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
if -170 < z < 3.99999999999999982e-6Initial program 99.9%
Taylor expanded in z around 0 99.8%
if 3.99999999999999982e-6 < z Initial program 93.4%
Taylor expanded in x around inf 43.4%
mul-1-neg43.4%
distribute-rgt-neg-out43.4%
Simplified43.4%
expm1-log1p-u43.1%
expm1-udef43.1%
associate-/r*43.2%
pow143.2%
pow143.2%
pow-div43.2%
metadata-eval43.2%
metadata-eval43.2%
add-sqr-sqrt17.0%
sqrt-unprod43.8%
sqr-neg43.8%
sqrt-prod26.9%
add-sqr-sqrt43.3%
Applied egg-rr43.3%
expm1-def43.3%
expm1-log1p44.7%
Simplified44.7%
Taylor expanded in x around inf 100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= z -260.0) (+ x (/ -1.0 x)) (if (<= z 4e-6) (+ x (/ -1.0 (+ x (/ -1.1283791670955126 y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -260.0) {
tmp = x + (-1.0 / x);
} else if (z <= 4e-6) {
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 <= (-260.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 4d-6) 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 <= -260.0) {
tmp = x + (-1.0 / x);
} else if (z <= 4e-6) {
tmp = x + (-1.0 / (x + (-1.1283791670955126 / y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -260.0: tmp = x + (-1.0 / x) elif z <= 4e-6: tmp = x + (-1.0 / (x + (-1.1283791670955126 / y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -260.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 4e-6) 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 <= -260.0) tmp = x + (-1.0 / x); elseif (z <= 4e-6) tmp = x + (-1.0 / (x + (-1.1283791670955126 / y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -260.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-6], 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 -260:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x + \frac{-1}{x + \frac{-1.1283791670955126}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -260Initial program 89.7%
remove-double-neg89.7%
neg-mul-189.7%
associate-/l*89.9%
neg-mul-189.9%
associate-/r*89.9%
div-sub90.3%
metadata-eval90.3%
associate-/l*90.3%
*-commutative90.3%
neg-mul-190.3%
distribute-lft-neg-out90.3%
/-rgt-identity90.3%
div-sub90.0%
associate-/r*90.0%
neg-mul-190.0%
*-rgt-identity90.0%
times-frac90.0%
/-rgt-identity90.0%
*-commutative90.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
if -260 < z < 3.99999999999999982e-6Initial program 99.9%
remove-double-neg99.9%
neg-mul-199.9%
associate-/l*99.9%
neg-mul-199.9%
associate-/r*99.9%
div-sub99.9%
metadata-eval99.9%
associate-/l*99.9%
*-commutative99.9%
neg-mul-199.9%
distribute-lft-neg-out99.9%
/-rgt-identity99.9%
div-sub99.9%
associate-/r*99.9%
neg-mul-199.9%
*-rgt-identity99.9%
times-frac99.9%
/-rgt-identity99.9%
*-commutative99.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around 0 99.5%
cancel-sign-sub-inv99.5%
metadata-eval99.5%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
if 3.99999999999999982e-6 < z Initial program 93.4%
Taylor expanded in x around inf 43.4%
mul-1-neg43.4%
distribute-rgt-neg-out43.4%
Simplified43.4%
expm1-log1p-u43.1%
expm1-udef43.1%
associate-/r*43.2%
pow143.2%
pow143.2%
pow-div43.2%
metadata-eval43.2%
metadata-eval43.2%
add-sqr-sqrt17.0%
sqrt-unprod43.8%
sqr-neg43.8%
sqrt-prod26.9%
add-sqr-sqrt43.3%
Applied egg-rr43.3%
expm1-def43.3%
expm1-log1p44.7%
Simplified44.7%
Taylor expanded in x around inf 100.0%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (<= z -200.0) (+ x (/ -1.0 x)) (if (<= z 4e-6) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -200.0) {
tmp = x + (-1.0 / x);
} else if (z <= 4e-6) {
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 <= (-200.0d0)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 4d-6) 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 <= -200.0) {
tmp = x + (-1.0 / x);
} else if (z <= 4e-6) {
tmp = x + (y / (1.1283791670955126 - (x * y)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -200.0: tmp = x + (-1.0 / x) elif z <= 4e-6: tmp = x + (y / (1.1283791670955126 - (x * y))) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -200.0) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 4e-6) 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 <= -200.0) tmp = x + (-1.0 / x); elseif (z <= 4e-6) tmp = x + (y / (1.1283791670955126 - (x * y))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -200.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-6], 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 -200:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-6}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -200Initial program 89.7%
remove-double-neg89.7%
neg-mul-189.7%
associate-/l*89.9%
neg-mul-189.9%
associate-/r*89.9%
div-sub90.3%
metadata-eval90.3%
associate-/l*90.3%
*-commutative90.3%
neg-mul-190.3%
distribute-lft-neg-out90.3%
/-rgt-identity90.3%
div-sub90.0%
associate-/r*90.0%
neg-mul-190.0%
*-rgt-identity90.0%
times-frac90.0%
/-rgt-identity90.0%
*-commutative90.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
if -200 < z < 3.99999999999999982e-6Initial program 99.9%
Taylor expanded in z around 0 99.5%
if 3.99999999999999982e-6 < z Initial program 93.4%
Taylor expanded in x around inf 43.4%
mul-1-neg43.4%
distribute-rgt-neg-out43.4%
Simplified43.4%
expm1-log1p-u43.1%
expm1-udef43.1%
associate-/r*43.2%
pow143.2%
pow143.2%
pow-div43.2%
metadata-eval43.2%
metadata-eval43.2%
add-sqr-sqrt17.0%
sqrt-unprod43.8%
sqr-neg43.8%
sqrt-prod26.9%
add-sqr-sqrt43.3%
Applied egg-rr43.3%
expm1-def43.3%
expm1-log1p44.7%
Simplified44.7%
Taylor expanded in x around inf 100.0%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= z -3.15e-24) x (if (<= z 2.5e-34) (+ x (* y 0.8862269254527579)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.15e-24) {
tmp = x;
} else if (z <= 2.5e-34) {
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 <= (-3.15d-24)) then
tmp = x
else if (z <= 2.5d-34) 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 <= -3.15e-24) {
tmp = x;
} else if (z <= 2.5e-34) {
tmp = x + (y * 0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.15e-24: tmp = x elif z <= 2.5e-34: tmp = x + (y * 0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.15e-24) tmp = x; elseif (z <= 2.5e-34) 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 <= -3.15e-24) tmp = x; elseif (z <= 2.5e-34) tmp = x + (y * 0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.15e-24], x, If[LessEqual[z, 2.5e-34], N[(x + N[(y * 0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{-24}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-34}:\\
\;\;\;\;x + y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.1499999999999999e-24 or 2.5000000000000001e-34 < z Initial program 92.3%
Taylor expanded in x around inf 68.4%
mul-1-neg68.4%
distribute-rgt-neg-out68.4%
Simplified68.4%
expm1-log1p-u59.0%
expm1-udef59.0%
associate-/r*60.8%
pow160.8%
pow160.8%
pow-div60.8%
metadata-eval60.8%
metadata-eval60.8%
add-sqr-sqrt32.9%
sqrt-unprod55.9%
sqr-neg55.9%
sqrt-prod28.3%
add-sqr-sqrt51.4%
Applied egg-rr51.4%
expm1-def51.4%
expm1-log1p52.1%
Simplified52.1%
Taylor expanded in x around inf 76.6%
if -3.1499999999999999e-24 < z < 2.5000000000000001e-34Initial program 99.9%
remove-double-neg99.9%
neg-mul-199.9%
associate-/l*99.9%
neg-mul-199.9%
associate-/r*99.9%
div-sub99.9%
metadata-eval99.9%
associate-/l*99.9%
*-commutative99.9%
neg-mul-199.9%
distribute-lft-neg-out99.9%
/-rgt-identity99.9%
div-sub99.9%
associate-/r*99.9%
neg-mul-199.9%
*-rgt-identity99.9%
times-frac99.9%
/-rgt-identity99.9%
*-commutative99.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around 0 99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 80.0%
*-commutative80.0%
Simplified80.0%
Final simplification78.1%
(FPCore (x y z) :precision binary64 (if (<= z -3.7e-21) (+ x (/ -1.0 x)) (if (<= z 1.15e-32) (+ x (* y 0.8862269254527579)) x)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.7e-21) {
tmp = x + (-1.0 / x);
} else if (z <= 1.15e-32) {
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 <= (-3.7d-21)) then
tmp = x + ((-1.0d0) / x)
else if (z <= 1.15d-32) 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 <= -3.7e-21) {
tmp = x + (-1.0 / x);
} else if (z <= 1.15e-32) {
tmp = x + (y * 0.8862269254527579);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.7e-21: tmp = x + (-1.0 / x) elif z <= 1.15e-32: tmp = x + (y * 0.8862269254527579) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.7e-21) tmp = Float64(x + Float64(-1.0 / x)); elseif (z <= 1.15e-32) 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 <= -3.7e-21) tmp = x + (-1.0 / x); elseif (z <= 1.15e-32) tmp = x + (y * 0.8862269254527579); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.7e-21], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-32], N[(x + N[(y * 0.8862269254527579), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-21}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-32}:\\
\;\;\;\;x + y \cdot 0.8862269254527579\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.7000000000000002e-21Initial program 90.4%
remove-double-neg90.4%
neg-mul-190.4%
associate-/l*90.6%
neg-mul-190.6%
associate-/r*90.6%
div-sub90.9%
metadata-eval90.9%
associate-/l*90.9%
*-commutative90.9%
neg-mul-190.9%
distribute-lft-neg-out90.9%
/-rgt-identity90.9%
div-sub90.7%
associate-/r*90.7%
neg-mul-190.7%
*-rgt-identity90.7%
times-frac90.7%
/-rgt-identity90.7%
*-commutative90.7%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around inf 98.7%
if -3.7000000000000002e-21 < z < 1.15e-32Initial program 99.9%
remove-double-neg99.9%
neg-mul-199.9%
associate-/l*99.9%
neg-mul-199.9%
associate-/r*99.9%
div-sub99.9%
metadata-eval99.9%
associate-/l*99.9%
*-commutative99.9%
neg-mul-199.9%
distribute-lft-neg-out99.9%
/-rgt-identity99.9%
div-sub99.9%
associate-/r*99.9%
neg-mul-199.9%
*-rgt-identity99.9%
times-frac99.9%
/-rgt-identity99.9%
*-commutative99.9%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around 0 99.8%
cancel-sign-sub-inv99.8%
metadata-eval99.8%
associate-*r/99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 80.0%
*-commutative80.0%
Simplified80.0%
if 1.15e-32 < z Initial program 94.3%
Taylor expanded in x around inf 46.4%
mul-1-neg46.4%
distribute-rgt-neg-out46.4%
Simplified46.4%
expm1-log1p-u46.1%
expm1-udef46.1%
associate-/r*46.1%
pow146.1%
pow146.1%
pow-div46.1%
metadata-eval46.1%
metadata-eval46.1%
add-sqr-sqrt19.1%
sqrt-unprod46.8%
sqr-neg46.8%
sqrt-prod27.8%
add-sqr-sqrt45.0%
Applied egg-rr45.0%
expm1-def45.0%
expm1-log1p46.3%
Simplified46.3%
Taylor expanded in x around inf 94.5%
Final simplification89.3%
(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.6%
Taylor expanded in x around inf 68.2%
mul-1-neg68.2%
distribute-rgt-neg-out68.2%
Simplified68.2%
expm1-log1p-u61.2%
expm1-udef61.2%
associate-/r*62.3%
pow162.3%
pow162.3%
pow-div62.3%
metadata-eval62.3%
metadata-eval62.3%
add-sqr-sqrt33.9%
sqrt-unprod59.7%
sqr-neg59.7%
sqrt-prod28.8%
add-sqr-sqrt55.1%
Applied egg-rr55.1%
expm1-def55.1%
expm1-log1p55.8%
Simplified55.8%
Taylor expanded in x around inf 74.6%
Final simplification74.6%
(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 2023268
(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)))))