Average Error: 9.2 → 0.2
Time: 36.9s
Precision: 64
Internal Precision: 320
$x \cdot \sqrt{\cos t + \left(h \cdot h\right) \cdot \sin t}$
$\begin{array}{l} \mathbf{if}\;h \le -1.198297063863589 \cdot 10^{+157}:\\ \;\;\;\;x \cdot \left(-\left(\frac{1}{2} \cdot \left(\frac{\cos t}{h} \cdot \sqrt{\frac{1}{\sin t}}\right) + h \cdot \sqrt{\sin t}\right)\right)\\ \mathbf{if}\;h \le 5.5328513403833364 \cdot 10^{+150}:\\ \;\;\;\;x \cdot \sqrt{\cos t + h \cdot \left(h \cdot \sin t\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{1}{2} \cdot \left(\frac{\cos t}{h} \cdot \sqrt{\frac{1}{\sin t}}\right) + h \cdot \sqrt{\sin t}\right)\\ \end{array}$

# Try it out

Your Program's Arguments

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 3 regimes
2. ## if h < -1.198297063863589e+157

1. Initial program 61.0

$x \cdot \sqrt{\cos t + \left(h \cdot h\right) \cdot \sin t}$
2. Taylor expanded around -inf 0.3

$\leadsto x \cdot \color{blue}{\left(-\left(\frac{1}{2} \cdot \left(\frac{\cos t}{h} \cdot \sqrt{\frac{1}{\sin t}}\right) + h \cdot \sqrt{\sin t}\right)\right)}$

## if -1.198297063863589e+157 < h < 5.5328513403833364e+150

1. Initial program 0.2

$x \cdot \sqrt{\cos t + \left(h \cdot h\right) \cdot \sin t}$
2. Using strategy rm
3. Applied associate-*l*0.1

$\leadsto x \cdot \sqrt{\cos t + \color{blue}{h \cdot \left(h \cdot \sin t\right)}}$

## if 5.5328513403833364e+150 < h

1. Initial program 58.8

$x \cdot \sqrt{\cos t + \left(h \cdot h\right) \cdot \sin t}$
2. Taylor expanded around inf 0.4

$\leadsto x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left(\frac{\cos t}{h} \cdot \sqrt{\frac{1}{\sin t}}\right) + h \cdot \sqrt{\sin t}\right)}$
3. Recombined 3 regimes into one program.

# Runtime

Time bar (total: 36.9s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)'
(FPCore (x t h)
:name "x*sqrt(cos(t)+h*h*sin(t))"
(* x (sqrt (+ (cos t) (* (* h h) (sin t))))))