Average Error: 36.7 → 0
Time: 43.1s
Precision: 64
Internal Precision: 2432
\[\frac{\tan \left(\frac{x}{y \cdot 2.0}\right)}{\sin \left(\frac{x}{y \cdot 2.0}\right)}\]
\[1.0\]

Error

Bits error versus x

Bits error versus y

Target

Original36.7
Target9.8
Herbie0
\[\begin{array}{l} \mathbf{if}\;y \lt -1.2303690911306994 \cdot 10^{+114}:\\ \;\;\;\;1.0\\ \mathbf{if}\;y \lt -9.102852406811914 \cdot 10^{-222}:\\ \;\;\;\;\frac{\sin \left(\frac{x}{y \cdot 2.0}\right)}{\sin \left(\frac{x}{y \cdot 2.0}\right) \cdot \log \left(e^{\cos \left(\frac{x}{y \cdot 2.0}\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;1.0\\ \end{array}\]

Derivation

  1. Initial program 36.7

    \[\frac{\tan \left(\frac{x}{y \cdot 2.0}\right)}{\sin \left(\frac{x}{y \cdot 2.0}\right)}\]
  2. Taylor expanded around 0 0

    \[\leadsto \color{blue}{1.0}\]
  3. Removed slow pow expressions.

Runtime

Time bar (total: 43.1s)Debug log

herbie shell --seed '#(1567391828 2030694642 2833800258 828025724 3004380912 3532991858)' +o setup:early-exit +o reduce:binary-search
(FPCore (x y)
  :name "Diagrams.TwoD.Layout.CirclePacking:approxRadius from diagrams-contrib-1.3.0.5"

  :herbie-target
  (if (< y -1.2303690911306994e+114) 1.0 (if (< y -9.102852406811914e-222) (/ (sin (/ x (* y 2.0))) (* (sin (/ x (* y 2.0))) (log (exp (cos (/ x (* y 2.0))))))) 1.0))

  (/ (tan (/ x (* y 2.0))) (sin (/ x (* y 2.0)))))