Average Error: 6.0 → 1.8
Time: 47.8s
Precision: 64
Internal Precision: 384
\[x + \frac{y \cdot \left(z - x\right)}{t}\]
\[\begin{array}{l} \mathbf{if}\;x \le -3.325266212781834 \cdot 10^{-104}:\\ \;\;\;\;x + \frac{z - x}{\frac{t}{y}}\\ \mathbf{if}\;x \le -9.987366539497674 \cdot 10^{-252}:\\ \;\;\;\;x + \frac{y \cdot \left(z - x\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z - x}{\frac{t}{y}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Target

Original6.0
Target2.0
Herbie1.8
\[x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)\]

Derivation

  1. Split input into 2 regimes
  2. if x < -3.325266212781834e-104 or -9.987366539497674e-252 < x

    1. Initial program 6.3

      \[x + \frac{y \cdot \left(z - x\right)}{t}\]
    2. Taylor expanded around 0 6.4

      \[\leadsto x + \frac{\color{blue}{z \cdot y - y \cdot x}}{t}\]
    3. Applied simplify1.5

      \[\leadsto \color{blue}{x + \frac{z - x}{\frac{t}{y}}}\]

    if -3.325266212781834e-104 < x < -9.987366539497674e-252

    1. Initial program 3.8

      \[x + \frac{y \cdot \left(z - x\right)}{t}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions.

Runtime

Time bar (total: 47.8s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit +o reduce:binary-search
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"

  :herbie-target
  (- x (+ (* x (/ y t)) (* (- z) (/ y t))))

  (+ x (/ (* y (- z x)) t)))