Average Error: 5.4 → 1.6
Time: 35.3s
Precision: 64
Internal Precision: 128
\[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
\[\begin{array}{l} \mathbf{if}\;t \le -0.0038955704157282956:\\ \;\;\;\;\left(\left(b \cdot c + \left(\left(\left(x \cdot \left(18.0 \cdot y\right)\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - 27.0 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;t \le 9.368170699811777 \cdot 10^{+50}:\\ \;\;\;\;(y \cdot \left(\left(18.0 \cdot z\right) \cdot \left(x \cdot t\right)\right) + \left((\left(a \cdot 4.0\right) \cdot \left(-t\right) + \left(b \cdot c\right))_*\right))_* - (j \cdot \left(27.0 \cdot k\right) + \left(\left(4.0 \cdot x\right) \cdot i\right))_*\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b \cdot c + \left(18.0 \cdot \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\right) - \left(a \cdot 4.0\right) \cdot t\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Bits error versus j

Bits error versus k

Derivation

  1. Split input into 3 regimes
  2. if t < -0.0038955704157282956

    1. Initial program 1.8

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Taylor expanded around inf 1.6

      \[\leadsto \left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \color{blue}{27.0 \cdot \left(j \cdot k\right)}\]
    3. Using strategy rm
    4. Applied associate-*l*1.6

      \[\leadsto \left(\left(\left(\left(\color{blue}{\left(x \cdot \left(18.0 \cdot y\right)\right)} \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - 27.0 \cdot \left(j \cdot k\right)\]

    if -0.0038955704157282956 < t < 9.368170699811777e+50

    1. Initial program 7.1

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Initial simplification7.6

      \[\leadsto (t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot 18.0\right)\right) + \left((\left(a \cdot 4.0\right) \cdot \left(-t\right) + \left(c \cdot b\right))_*\right))_* - (j \cdot \left(k \cdot 27.0\right) + \left(\left(x \cdot 4.0\right) \cdot i\right))_*\]
    3. Taylor expanded around inf 7.4

      \[\leadsto \color{blue}{\left(\left(18.0 \cdot \left(t \cdot \left(x \cdot \left(z \cdot y\right)\right)\right) + b \cdot c\right) - 4.0 \cdot \left(a \cdot t\right)\right)} - (j \cdot \left(k \cdot 27.0\right) + \left(\left(x \cdot 4.0\right) \cdot i\right))_*\]
    4. Simplified1.6

      \[\leadsto \color{blue}{(y \cdot \left(\left(z \cdot 18.0\right) \cdot \left(x \cdot t\right)\right) + \left((\left(a \cdot 4.0\right) \cdot \left(-t\right) + \left(b \cdot c\right))_*\right))_*} - (j \cdot \left(k \cdot 27.0\right) + \left(\left(x \cdot 4.0\right) \cdot i\right))_*\]

    if 9.368170699811777e+50 < t

    1. Initial program 1.6

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Taylor expanded around inf 1.3

      \[\leadsto \left(\left(\left(\color{blue}{18.0 \cdot \left(t \cdot \left(x \cdot \left(z \cdot y\right)\right)\right)} - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -0.0038955704157282956:\\ \;\;\;\;\left(\left(b \cdot c + \left(\left(\left(x \cdot \left(18.0 \cdot y\right)\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - 27.0 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;t \le 9.368170699811777 \cdot 10^{+50}:\\ \;\;\;\;(y \cdot \left(\left(18.0 \cdot z\right) \cdot \left(x \cdot t\right)\right) + \left((\left(a \cdot 4.0\right) \cdot \left(-t\right) + \left(b \cdot c\right))_*\right))_* - (j \cdot \left(27.0 \cdot k\right) + \left(\left(4.0 \cdot x\right) \cdot i\right))_*\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b \cdot c + \left(18.0 \cdot \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\right) - \left(a \cdot 4.0\right) \cdot t\right)\right) - \left(4.0 \cdot x\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\ \end{array}\]

Reproduce

herbie shell --seed 2018362 +o rules:numerics
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1"
  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))

Details

Time bar (total: 26.2s)Debug log

start265.0ms

Algorithm
intervals

setup210.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 1.9b

localize93.0ms

Local error

Found 4 expressions with local error:

6.2b
(* (* (* x 18.0) y) z)
5.1b
(* (* (* (* x 18.0) y) z) t)
0.5b
(* (* j 27.0) k)
0.2b
(* (* x 18.0) y)

rewrite46.0ms

Algorithm
rewrite-expression-head
Counts
4 → 44
Calls

4 calls. Slowest were:

25.0ms
(* (* (* (* x 18.0) y) z) t)
12.0ms
(* (* (* x 18.0) y) z)
4.0ms
(* (* j 27.0) k)

series123.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

54.0ms
(* (* (* (* x 18.0) y) z) t)
30.0ms
(* (* (* x 18.0) y) z)
19.0ms
(* (* x 18.0) y)
19.0ms
(* (* j 27.0) k)

simplify556.0ms

Counts
14 → 56
Calls

14 calls. Slowest were:

222.0ms
(* 18.0 (* t (* x (* z y))))
211.0ms
(* 18.0 (* t (* x (* z y))))
25.0ms
(* 18.0 (* x (* z y)))

prune1.5s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.5b

localize9.0ms

Local error

Found 4 expressions with local error:

6.2b
(* (* (* x 18.0) y) z)
5.1b
(* (* (* (* x 18.0) y) z) t)
0.3b
(* 27.0 (* j k))
0.2b
(* (* x 18.0) y)

rewrite34.0ms

Algorithm
rewrite-expression-head
Counts
4 → 44
Calls

4 calls. Slowest were:

22.0ms
(* (* (* (* x 18.0) y) z) t)
6.0ms
(* (* (* x 18.0) y) z)
5.0ms
(* (* x 18.0) y)

series107.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

50.0ms
(* (* (* (* x 18.0) y) z) t)
33.0ms
(* (* (* x 18.0) y) z)
12.0ms
(* (* x 18.0) y)
11.0ms
(* 27.0 (* j k))

simplify505.0ms

Counts
14 → 56
Calls

14 calls. Slowest were:

204.0ms
(* 18.0 (* t (* x (* z y))))
175.0ms
(* 18.0 (* t (* x (* z y))))
24.0ms
(* 18.0 (* x (* z y)))

prune1.5s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.5b

localize25.0ms

Local error

Found 4 expressions with local error:

6.2b
(* (* x (* 18.0 y)) z)
5.1b
(* (* (* x (* 18.0 y)) z) t)
0.3b
(* 27.0 (* j k))
0.2b
(* x (* 18.0 y))

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 44
Calls

4 calls. Slowest were:

7.0ms
(* (* (* x (* 18.0 y)) z) t)
3.0ms
(* (* x (* 18.0 y)) z)
1.0ms
(* 27.0 (* j k))

series71.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

29.0ms
(* (* (* x (* 18.0 y)) z) t)
19.0ms
(* (* x (* 18.0 y)) z)
12.0ms
(* x (* 18.0 y))
11.0ms
(* 27.0 (* j k))

simplify580.0ms

Counts
13 → 56
Calls

13 calls. Slowest were:

245.0ms
(* 18.0 (* t (* x (* z y))))
181.0ms
(* 18.0 (* t (* x (* z y))))
43.0ms
(* 18.0 (* x (* z y)))

prune1.5s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.5b

localize35.0ms

Local error

Found 4 expressions with local error:

5.4b
(* (* y z) (* x 18.0))
2.0b
(fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))
0.4b
(fma j (* k 27.0) (* (* x 4.0) i))
0.0b
(- (fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b))) (fma j (* k 27.0) (* (* x 4.0) i)))

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

8.0ms
(- (fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b))) (fma j (* k 27.0) (* (* x 4.0) i)))
7.0ms
(* (* y z) (* x 18.0))
0.0ms
(fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))

series3.2s

Counts
4 → 12
Calls

4 calls. Slowest were:

3.0s
(- (fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b))) (fma j (* k 27.0) (* (* x 4.0) i)))
167.0ms
(fma t (* (* y z) (* x 18.0)) (fma (* a 4.0) (- t) (* c b)))
41.0ms
(fma j (* k 27.0) (* (* x 4.0) i))
21.0ms
(* (* y z) (* x 18.0))

simplify10.1s

Counts
41 → 77
Calls

41 calls. Slowest were:

914.0ms
(fma (- (fma j (* k 27.0) (* (* x 4.0) i))) 1 (* (fma j (* k 27.0) (* (* x 4.0) i)) 1))
749.0ms
(* (* (* (* y z) (* y z)) (* y z)) (* (* (* x 18.0) (* x 18.0)) (* x 18.0)))
540.0ms
(fma (- (fma j (* k 27.0) (* (* x 4.0) i))) 1 (* (fma j (* k 27.0) (* (* x 4.0) i)) 1))

prune2.0s

Pruning

10 alts after pruning (8 fresh and 2 done)

Merged error: 0.0b

regimes2.8s

Accuracy

71.5% (1.5b remaining)

Error of 1.6b against oracle of 0.1b and baseline of 5.3b

bsearch858.0ms