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}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original18.4
Comparison18.0
Herbie16.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

  1. Split input into 2 regimes.
  2. if x < 2.1372757541004473e+172

    1. Initial program 16.5

      \[2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
    2. Applied simplify 16.5

      \[\leadsto \color{blue}{2.0 \cdot \sqrt{\left(y + z\right) \cdot x + y \cdot z}}\]
    3. Applied taylor 16.5

      \[\leadsto 2.0 \cdot \sqrt{z \cdot y + \left(y \cdot x + z \cdot x\right)}\]
    4. Taylor expanded around inf 16.5

      \[\leadsto 2.0 \cdot \sqrt{\color{blue}{z \cdot y + \left(y \cdot x + z \cdot x\right)}}\]
    5. 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

    1. Initial program 42.2

      \[2.0 \cdot \sqrt{\left(x \cdot y + x \cdot z\right) + y \cdot z}\]
    2. Applied simplify 42.2

      \[\leadsto \color{blue}{2.0 \cdot \sqrt{\left(y + z\right) \cdot x + y \cdot z}}\]
    3. Using strategy rm
    4. 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}\]
    5. 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\]
    6. 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\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 44.9s) Debug log

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)))))