Average Error: 44.9 → 0
Time: 20.3s
Precision: 64
Internal Precision: 384
\[x \cdot \sqrt{y \cdot y - z \cdot z}\]
\[\begin{array}{l} \mathbf{if}\;y \le 1.5622464906955437 \cdot 10^{-289}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original44.9
Target15.7
Herbie0
\[\begin{array}{l} \mathbf{if}\;y \lt 2.5816096488251695 \cdot 10^{-278}:\\ \;\;\;\;-x \cdot y\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\sqrt{y + z} \cdot \sqrt{y - z}\right)\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if y < 1.5622464906955437e-289

    1. Initial program 45.6

      \[x \cdot \sqrt{y \cdot y - z \cdot z}\]
    2. Taylor expanded around -inf 0

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot y\right)}\]
    3. Applied simplify0

      \[\leadsto \color{blue}{y \cdot \left(-x\right)}\]

    if 1.5622464906955437e-289 < y

    1. Initial program 44.2

      \[x \cdot \sqrt{y \cdot y - z \cdot z}\]
    2. Taylor expanded around inf 0

      \[\leadsto x \cdot \color{blue}{y}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 20.3s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit
(FPCore (x y z)
  :name "Diagrams.TwoD.Apollonian:initialConfig from diagrams-contrib-1.3.0.5, B"

  :herbie-target
  (if (< y 2.5816096488251695e-278) (- (* x y)) (* x (* (sqrt (+ y z)) (sqrt (- y z)))))

  (* x (sqrt (- (* y y) (* z z)))))