Average Error: 18.4 → 16.5
Time: 44.9s
Precision: 64
Internal precision: 128
\[2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;x \le 2.1372757541004473 \cdot 10^{+172}:\\
\;\;\;\;2.0 \cdot \sqrt{\left(z + x\right) \cdot y + x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;2.0 \cdot {\left(\frac{1}{4} \cdot \left(z \cdot \left(e^{\frac{-1}{4} \cdot \left(3 \cdot \log z + 3 \cdot \log x\right)} \cdot y\right)\right) + \left(e^{\frac{1}{4} \cdot \left(\log z + \log x\right)} + \frac{1}{4} \cdot \left(e^{\frac{-1}{4} \cdot \left(3 \cdot \log z + 3 \cdot \log x\right)} \cdot \left(y \cdot x\right)\right)\right)\right)}^2\\
\end{array}\]
Target
| Original | 18.4 |
| Comparison | 18.0 |
| Herbie | 16.5 |
\[ \begin{array}{l}
\mathbf{if}\;z \lt 7.636950090573675 \cdot 10^{+176}:\\
\;\;\;\;2.0 \cdot \sqrt{\left(x + y\right) \cdot z + x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{1}{4} \cdot \left(\left({y}^{\frac{-3}{4}} \cdot \left({z}^{\frac{-3}{4}} \cdot x\right)\right) \cdot \left(y + z\right)\right) + {z}^{\frac{1}{4}} \cdot {y}^{\frac{1}{4}}\right)}^2 \cdot 2.0\\
\end{array} \]
Derivation
- Split input into 2 regimes.
-
if x < 2.1372757541004473e+172
Initial program 16.5
\[2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
Applied simplify 16.5
\[\leadsto \color{blue}{2.0 \cdot \sqrt{\left(y + z\right) \cdot x + y \cdot z}}\]
Applied taylor 16.5
\[\leadsto 2.0 \cdot \sqrt{z \cdot y + \left(y \cdot x + z \cdot x\right)}\]
Taylor expanded around inf 16.5
\[\leadsto 2.0 \cdot \sqrt{\color{blue}{z \cdot y + \left(y \cdot x + z \cdot x\right)}}\]
Applied simplify 16.5
\[\leadsto \color{blue}{2.0 \cdot \sqrt{\left(z + x\right) \cdot y + x \cdot z}}\]
if 2.1372757541004473e+172 < x
Initial program 42.2
\[2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
Applied simplify 42.2
\[\leadsto \color{blue}{2.0 \cdot \sqrt{\left(y + z\right) \cdot x + y \cdot z}}\]
- Using strategy
rm
Applied add-sqr-sqrt 42.4
\[\leadsto 2.0 \cdot \color{blue}{{\left(\sqrt{\sqrt{\left(y + z\right) \cdot x + y \cdot z}}\right)}^2}\]
Applied taylor 15.3
\[\leadsto 2.0 \cdot {\left(\frac{1}{4} \cdot \left(z \cdot \left(e^{\frac{-1}{4} \cdot \left(3 \cdot \log z + 3 \cdot \log x\right)} \cdot y\right)\right) + \left(e^{\frac{1}{4} \cdot \left(\log z + \log x\right)} + \frac{1}{4} \cdot \left(e^{\frac{-1}{4} \cdot \left(3 \cdot \log z + 3 \cdot \log x\right)} \cdot \left(y \cdot x\right)\right)\right)\right)}^2\]
Taylor expanded around 0 15.3
\[\leadsto 2.0 \cdot {\color{blue}{\left(\frac{1}{4} \cdot \left(z \cdot \left(e^{\frac{-1}{4} \cdot \left(3 \cdot \log z + 3 \cdot \log x\right)} \cdot y\right)\right) + \left(e^{\frac{1}{4} \cdot \left(\log z + \log x\right)} + \frac{1}{4} \cdot \left(e^{\frac{-1}{4} \cdot \left(3 \cdot \log z + 3 \cdot \log x\right)} \cdot \left(y \cdot x\right)\right)\right)\right)}}^2\]
- Recombined 2 regimes into one program.
- Removed slow pow expressions
Runtime
Please include this information when filing a bug report:
herbie --seed '#(3413778629 3539019817 3948427809 1624820574 1864485365 1328057387)'
(FPCore (x y z)
:name "Diagrams.TwoD.Apollonian:descartes from diagrams-contrib-1.3.0.5"
:target
(if (< z 7.636950090573675e+176) (* 2.0 (sqrt (+ (* (+ x y) z) (* x y)))) (* (sqr (+ (* 1/4 (* (* (pow y -3/4) (* (pow z -3/4) x)) (+ y z))) (* (pow z 1/4) (pow y 1/4)))) 2.0))
(* 2.0 (sqrt (+ (+ (* x y) (* x z)) (* y z)))))