Average Error: 1.7 → 1.7
Time: 10.0s
Precision: 64
Internal Precision: 128
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\left|\left(\frac{x}{y} + \frac{4}{y}\right) - z \cdot \frac{x}{y}\right|\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 1.7

    \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
  2. Taylor expanded around inf 1.7

    \[\leadsto \left|\color{blue}{\left(\frac{x}{y} + 4 \cdot \frac{1}{y}\right)} - \frac{x}{y} \cdot z\right|\]
  3. Simplified1.7

    \[\leadsto \left|\color{blue}{\left(\frac{x}{y} + \frac{4}{y}\right)} - \frac{x}{y} \cdot z\right|\]
  4. Final simplification1.7

    \[\leadsto \left|\left(\frac{x}{y} + \frac{4}{y}\right) - z \cdot \frac{x}{y}\right|\]

Reproduce

herbie shell --seed 2019010 
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))

Details

Time bar (total: 9.4s)Debug log

sample71.0ms

Algorithm
intervals

simplify30.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
30.0ms
(fabs (- (/ (+ x 4) y) (* (/ x y) z)))

prune14.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 1.0b

localize17.0ms

Local error

Found 3 expressions with local error:

1.7b
(* (/ x y) z)
0.0b
(/ (+ x 4) y)
0.0b
(- (/ (+ x 4) y) (* (/ x y) z))

rewrite19.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
associate-*l*
associate-/l*
add-exp-log
associate-*l/
add-cbrt-cube
pow1
associate-/l/
div-inv
sub-div
flip--
flip-+
frac-sub
*-commutative
diff-log
flip3--
flip3-+
frac-2neg
sub-neg
clear-num
Counts
3 → 42
Calls
3 calls:
Slowest
11.0ms
(- (/ (+ x 4) y) (* (/ x y) z))
4.0ms
(/ (+ x 4) y)
3.0ms
(* (/ x y) z)

series78.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
44.0ms
(- (/ (+ x 4) y) (* (/ x y) z))
19.0ms
(* (/ x y) z)
14.0ms
(/ (+ x 4) y)

simplify427.0ms

Counts
20 → 51
Calls
20 calls:
Slowest
86.0ms
(- (* (+ x 4) y) (* y (* x z)))
70.0ms
(- (+ (/ x y) (* 4 (/ 1 y))) (/ (* x z) y))
56.0ms
(/ (exp (/ (+ x 4) y)) (exp (* (/ x y) z)))
50.0ms
(- (+ (/ x y) (* 4 (/ 1 y))) (/ (* x z) y))
47.0ms
(- (+ (/ x y) (* 4 (/ 1 y))) (/ (* x z) y))

prune445.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.0b

localize20.0ms

Local error

Found 3 expressions with local error:

1.7b
(* (/ x y) z)
0.0b
(- (+ (/ x y) (/ 4 y)) (* (/ x y) z))
0.0b
(+ (/ x y) (/ 4 y))

rewrite43.0ms

Algorithm
rewrite-expression-head
Rules
10×add-log-exp
*-un-lft-identity
add-cube-cbrt
associate-*l/
associate-*l*
add-sqr-sqrt
div-inv
frac-sub
add-exp-log
add-cbrt-cube
pow1
flip-+
frac-add
diff-log
flip3-+
sum-log
distribute-lft-out
flip--
*-commutative
associate--l+
flip3--
distribute-rgt-out
sub-neg
+-commutative
Counts
3 → 44
Calls
3 calls:
Slowest
35.0ms
(- (+ (/ x y) (/ 4 y)) (* (/ x y) z))
4.0ms
(* (/ x y) z)
3.0ms
(+ (/ x y) (/ 4 y))

series79.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
38.0ms
(- (+ (/ x y) (/ 4 y)) (* (/ x y) z))
24.0ms
(+ (/ x y) (/ 4 y))
17.0ms
(* (/ x y) z)

simplify1.5s

Counts
27 → 53
Calls
27 calls:
Slowest
353.0ms
(- (* (+ (pow (/ x y) 3) (pow (/ 4 y) 3)) y) (* (+ (* (/ x y) (/ x y)) (- (* (/ 4 y) (/ 4 y)) (* (/ x y) (/ 4 y)))) (* x z)))
234.0ms
(- (* (+ (* x y) (* y 4)) y) (* (* y y) (* x z)))
209.0ms
(- (* (- (* (/ x y) (/ x y)) (* (/ 4 y) (/ 4 y))) y) (* (- (/ x y) (/ 4 y)) (* x z)))
199.0ms
(* (+ (* (/ x y) (/ x y)) (- (* (/ 4 y) (/ 4 y)) (* (/ x y) (/ 4 y)))) y)
100.0ms
(/ (exp (+ (/ x y) (/ 4 y))) (exp (* (/ x y) z)))

prune495.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0b

localize15.0ms

Local error

Found 4 expressions with local error:

8.3b
(cbrt (/ x y))
8.3b
(cbrt (/ x y))
8.3b
(cbrt (/ x y))
0.7b
(* (* (cbrt (/ x y)) (cbrt (/ x y))) (* (cbrt (/ x y)) z))

rewrite30.0ms

Algorithm
rewrite-expression-head
Rules
15×cbrt-div
12×cbrt-prod
add-exp-log
associate-*l/
pow1
add-cube-cbrt
add-cbrt-cube
*-un-lft-identity
add-sqr-sqrt
frac-times
add-log-exp
div-inv
cbrt-unprod
associate-*r/
prod-exp
pow-prod-down
pow1/3
*-commutative
associate-*l*
associate-*r*
Counts
4 → 62
Calls
4 calls:
Slowest
27.0ms
(* (* (cbrt (/ x y)) (cbrt (/ x y))) (* (cbrt (/ x y)) z))
1.0ms
(cbrt (/ x y))
1.0ms
(cbrt (/ x y))
1.0ms
(cbrt (/ x y))

series241.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
81.0ms
(cbrt (/ x y))
70.0ms
(cbrt (/ x y))
65.0ms
(cbrt (/ x y))
24.0ms
(* (* (cbrt (/ x y)) (cbrt (/ x y))) (* (cbrt (/ x y)) z))

simplify2.0s

Counts
44 → 74
Calls
44 calls:
Slowest
370.0ms
(* (* (* (* (cbrt (/ x y)) (cbrt (/ x y))) (* (cbrt (/ x y)) (cbrt (/ x y)))) (* (cbrt (/ x y)) (cbrt (/ x y)))) (* (* (* (cbrt (/ x y)) z) (* (cbrt (/ x y)) z)) (* (cbrt (/ x y)) z)))
363.0ms
(* (* (/ x y) (/ x y)) (* (* (* (cbrt (/ x y)) z) (* (cbrt (/ x y)) z)) (* (cbrt (/ x y)) z)))
182.0ms
(exp (* 1/3 (- (log (/ 1 y)) (log (/ 1 x)))))
151.0ms
(exp (* 1/3 (- (log (/ 1 y)) (log (/ 1 x)))))
146.0ms
(exp (* 1/3 (- (log (/ 1 y)) (log (/ 1 x)))))

prune892.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0b

localize12.0ms

Local error

Found 1 expressions with local error:

1.5b
(/ (- (+ x 4) (* x z)) y)

rewrite13.0ms

Algorithm
rewrite-expression-head
Rules
associate-/l*
associate-/l/
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
flip--
div-inv
add-exp-log
div-sub
add-cbrt-cube
flip3--
frac-2neg
clear-num
pow1
Counts
1 → 16
Calls
1 calls:
Slowest
12.0ms
(/ (- (+ x 4) (* x z)) y)

series32.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
32.0ms
(/ (- (+ x 4) (* x z)) y)

simplify504.0ms

Counts
8 → 19
Calls
8 calls:
Slowest
164.0ms
(- (pow (+ x 4) 3) (pow (* x z) 3))
95.0ms
(- (* (+ x 4) (+ x 4)) (* (* x z) (* x z)))
78.0ms
(- (+ (/ x y) (* 4 (/ 1 y))) (/ (* x z) y))
54.0ms
(- (+ (/ x y) (* 4 (/ 1 y))) (/ (* x z) y))
43.0ms
(- (+ (/ x y) (* 4 (/ 1 y))) (/ (* x z) y))

prune161.0ms

Pruning

5 alts after pruning (2 fresh and 3 done)

Merged error: 0b

regimes169.0ms

Accuracy

0% (1.6b remaining)

Error of 1.7b against oracle of 0.0b and baseline of 1.7b

bsearch1.0ms

end0.0ms

sample2.1s

Algorithm
intervals