| Alternative 1 | |
|---|---|
| Accuracy | 98.1% |
| Cost | 14276 |
\[\begin{array}{l}
t_0 := x + \frac{y}{e^{z} \cdot 1.1283791670955126 - x \cdot y}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{+206}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x + \frac{-1}{x}\\
\end{array}
\]
(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
(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 + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
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(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) end
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[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := N[(x + N[(-1.0 / N[(N[Exp[z], $MachinePrecision] * N[(-1.1283791670955126 / y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
x + \frac{-1}{\mathsf{fma}\left(e^{z}, \frac{-1.1283791670955126}{y}, x\right)}
| Original | 95.5% |
|---|---|
| Target | 99.9% |
| Herbie | 99.9% |
Initial program 95.5%
Simplified99.9%
[Start]95.5 | \[ x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\] |
|---|---|
*-lft-identity [<=]95.5 | \[ x + \color{blue}{1 \cdot \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}}
\] |
metadata-eval [<=]95.5 | \[ x + \color{blue}{\frac{-1}{-1}} \cdot \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\] |
times-frac [<=]95.5 | \[ x + \color{blue}{\frac{-1 \cdot y}{-1 \cdot \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}}
\] |
neg-mul-1 [<=]95.5 | \[ x + \frac{-1 \cdot y}{\color{blue}{-\left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}}
\] |
sub0-neg [<=]95.5 | \[ x + \frac{-1 \cdot y}{\color{blue}{0 - \left(1.1283791670955126 \cdot e^{z} - x \cdot y\right)}}
\] |
associate-+l- [<=]95.5 | \[ x + \frac{-1 \cdot y}{\color{blue}{\left(0 - 1.1283791670955126 \cdot e^{z}\right) + x \cdot y}}
\] |
neg-sub0 [<=]95.5 | \[ x + \frac{-1 \cdot y}{\color{blue}{\left(-1.1283791670955126 \cdot e^{z}\right)} + x \cdot y}
\] |
+-commutative [<=]95.5 | \[ x + \frac{-1 \cdot y}{\color{blue}{x \cdot y + \left(-1.1283791670955126 \cdot e^{z}\right)}}
\] |
sub-neg [<=]95.5 | \[ x + \frac{-1 \cdot y}{\color{blue}{x \cdot y - 1.1283791670955126 \cdot e^{z}}}
\] |
associate-/l* [=>]95.5 | \[ x + \color{blue}{\frac{-1}{\frac{x \cdot y - 1.1283791670955126 \cdot e^{z}}{y}}}
\] |
div-sub [=>]95.5 | \[ x + \frac{-1}{\color{blue}{\frac{x \cdot y}{y} - \frac{1.1283791670955126 \cdot e^{z}}{y}}}
\] |
associate-*r/ [<=]99.9 | \[ x + \frac{-1}{\color{blue}{x \cdot \frac{y}{y}} - \frac{1.1283791670955126 \cdot e^{z}}{y}}
\] |
*-inverses [=>]99.9 | \[ x + \frac{-1}{x \cdot \color{blue}{1} - \frac{1.1283791670955126 \cdot e^{z}}{y}}
\] |
*-rgt-identity [=>]99.9 | \[ x + \frac{-1}{\color{blue}{x} - \frac{1.1283791670955126 \cdot e^{z}}{y}}
\] |
associate-*l/ [<=]99.9 | \[ x + \frac{-1}{x - \color{blue}{\frac{1.1283791670955126}{y} \cdot e^{z}}}
\] |
cancel-sign-sub-inv [=>]99.9 | \[ x + \frac{-1}{\color{blue}{x + \left(-\frac{1.1283791670955126}{y}\right) \cdot e^{z}}}
\] |
distribute-lft-neg-in [<=]99.9 | \[ x + \frac{-1}{x + \color{blue}{\left(-\frac{1.1283791670955126}{y} \cdot e^{z}\right)}}
\] |
distribute-rgt-neg-in [=>]99.9 | \[ x + \frac{-1}{x + \color{blue}{\frac{1.1283791670955126}{y} \cdot \left(-e^{z}\right)}}
\] |
associate-*l/ [=>]99.9 | \[ x + \frac{-1}{x + \color{blue}{\frac{1.1283791670955126 \cdot \left(-e^{z}\right)}{y}}}
\] |
distribute-rgt-neg-in [<=]99.9 | \[ x + \frac{-1}{x + \frac{\color{blue}{-1.1283791670955126 \cdot e^{z}}}{y}}
\] |
Final simplification99.9%
| Alternative 1 | |
|---|---|
| Accuracy | 98.1% |
| Cost | 14276 |
| Alternative 2 | |
|---|---|
| Accuracy | 99.4% |
| Cost | 13896 |
| Alternative 3 | |
|---|---|
| Accuracy | 99.0% |
| Cost | 1096 |
| Alternative 4 | |
|---|---|
| Accuracy | 86.4% |
| Cost | 848 |
| Alternative 5 | |
|---|---|
| Accuracy | 98.9% |
| Cost | 840 |
| Alternative 6 | |
|---|---|
| Accuracy | 70.9% |
| Cost | 456 |
| Alternative 7 | |
|---|---|
| Accuracy | 70.9% |
| Cost | 456 |
| Alternative 8 | |
|---|---|
| Accuracy | 81.4% |
| Cost | 452 |
| Alternative 9 | |
|---|---|
| Accuracy | 68.9% |
| Cost | 64 |
herbie shell --seed 2023151
(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)))))