Average Error: 26.1 → 20.5
Time: 31.1s
Precision: 64
\[\left(\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot {y}^{2}\right) \cdot x - 56 \cdot {z}^{3}\right) \cdot x + 70 \cdot {p}^{4}\right) \cdot x\]
\[\begin{array}{l} \mathbf{if}\;{p}^{4} \le 3.090698260756107946675245635375307405025 \cdot 10^{68}:\\ \;\;\;\;\left(70 \cdot {p}^{4} + \left(\left(\left(28 \cdot \left(\left(y \cdot x\right) \cdot y\right) + {x}^{4}\right) - 7 \cdot {x}^{3}\right) - 56 \cdot {z}^{3}\right) \cdot x\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(70 \cdot {p}^{4}\right) \cdot x\\ \end{array}\]
\left(\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot {y}^{2}\right) \cdot x - 56 \cdot {z}^{3}\right) \cdot x + 70 \cdot {p}^{4}\right) \cdot x
\begin{array}{l}
\mathbf{if}\;{p}^{4} \le 3.090698260756107946675245635375307405025 \cdot 10^{68}:\\
\;\;\;\;\left(70 \cdot {p}^{4} + \left(\left(\left(28 \cdot \left(\left(y \cdot x\right) \cdot y\right) + {x}^{4}\right) - 7 \cdot {x}^{3}\right) - 56 \cdot {z}^{3}\right) \cdot x\right) \cdot x\\

\mathbf{else}:\\
\;\;\;\;\left(70 \cdot {p}^{4}\right) \cdot x\\

\end{array}
double f(double x, double y, double z, double p) {
        double r381298 = x;
        double r381299 = r381298 * r381298;
        double r381300 = 7.0;
        double r381301 = r381300 * r381298;
        double r381302 = r381299 - r381301;
        double r381303 = r381302 * r381298;
        double r381304 = 28.0;
        double r381305 = y;
        double r381306 = 2.0;
        double r381307 = pow(r381305, r381306);
        double r381308 = r381304 * r381307;
        double r381309 = r381303 + r381308;
        double r381310 = r381309 * r381298;
        double r381311 = 56.0;
        double r381312 = z;
        double r381313 = 3.0;
        double r381314 = pow(r381312, r381313);
        double r381315 = r381311 * r381314;
        double r381316 = r381310 - r381315;
        double r381317 = r381316 * r381298;
        double r381318 = 70.0;
        double r381319 = p;
        double r381320 = 4.0;
        double r381321 = pow(r381319, r381320);
        double r381322 = r381318 * r381321;
        double r381323 = r381317 + r381322;
        double r381324 = r381323 * r381298;
        return r381324;
}

double f(double x, double y, double z, double p) {
        double r381325 = p;
        double r381326 = 4.0;
        double r381327 = pow(r381325, r381326);
        double r381328 = 3.090698260756108e+68;
        bool r381329 = r381327 <= r381328;
        double r381330 = 70.0;
        double r381331 = r381330 * r381327;
        double r381332 = 28.0;
        double r381333 = y;
        double r381334 = x;
        double r381335 = r381333 * r381334;
        double r381336 = r381335 * r381333;
        double r381337 = r381332 * r381336;
        double r381338 = 4.0;
        double r381339 = pow(r381334, r381338);
        double r381340 = r381337 + r381339;
        double r381341 = 7.0;
        double r381342 = 3.0;
        double r381343 = pow(r381334, r381342);
        double r381344 = r381341 * r381343;
        double r381345 = r381340 - r381344;
        double r381346 = 56.0;
        double r381347 = z;
        double r381348 = 3.0;
        double r381349 = pow(r381347, r381348);
        double r381350 = r381346 * r381349;
        double r381351 = r381345 - r381350;
        double r381352 = r381351 * r381334;
        double r381353 = r381331 + r381352;
        double r381354 = r381353 * r381334;
        double r381355 = r381331 * r381334;
        double r381356 = r381329 ? r381354 : r381355;
        return r381356;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus p

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (pow p 4.0) < 3.090698260756108e+68

    1. Initial program 22.1

      \[\left(\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot {y}^{2}\right) \cdot x - 56 \cdot {z}^{3}\right) \cdot x + 70 \cdot {p}^{4}\right) \cdot x\]
    2. Taylor expanded around 0 22.1

      \[\leadsto \left(\left(\color{blue}{\left(\left({x}^{4} + 28 \cdot \left(x \cdot {y}^{2}\right)\right) - 7 \cdot {x}^{3}\right)} - 56 \cdot {z}^{3}\right) \cdot x + 70 \cdot {p}^{4}\right) \cdot x\]
    3. Using strategy rm
    4. Applied sqr-pow22.1

      \[\leadsto \left(\left(\left(\left({x}^{4} + 28 \cdot \left(x \cdot \color{blue}{\left({y}^{\left(\frac{2}{2}\right)} \cdot {y}^{\left(\frac{2}{2}\right)}\right)}\right)\right) - 7 \cdot {x}^{3}\right) - 56 \cdot {z}^{3}\right) \cdot x + 70 \cdot {p}^{4}\right) \cdot x\]
    5. Applied associate-*r*15.9

      \[\leadsto \left(\left(\left(\left({x}^{4} + 28 \cdot \color{blue}{\left(\left(x \cdot {y}^{\left(\frac{2}{2}\right)}\right) \cdot {y}^{\left(\frac{2}{2}\right)}\right)}\right) - 7 \cdot {x}^{3}\right) - 56 \cdot {z}^{3}\right) \cdot x + 70 \cdot {p}^{4}\right) \cdot x\]
    6. Simplified15.9

      \[\leadsto \left(\left(\left(\left({x}^{4} + 28 \cdot \left(\color{blue}{\left(y \cdot x\right)} \cdot {y}^{\left(\frac{2}{2}\right)}\right)\right) - 7 \cdot {x}^{3}\right) - 56 \cdot {z}^{3}\right) \cdot x + 70 \cdot {p}^{4}\right) \cdot x\]

    if 3.090698260756108e+68 < (pow p 4.0)

    1. Initial program 38.7

      \[\left(\left(\left(\left(x \cdot x - 7 \cdot x\right) \cdot x + 28 \cdot {y}^{2}\right) \cdot x - 56 \cdot {z}^{3}\right) \cdot x + 70 \cdot {p}^{4}\right) \cdot x\]
    2. Taylor expanded around 0 35.0

      \[\leadsto \left(\color{blue}{0} + 70 \cdot {p}^{4}\right) \cdot x\]
  3. Recombined 2 regimes into one program.
  4. Final simplification20.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;{p}^{4} \le 3.090698260756107946675245635375307405025 \cdot 10^{68}:\\ \;\;\;\;\left(70 \cdot {p}^{4} + \left(\left(\left(28 \cdot \left(\left(y \cdot x\right) \cdot y\right) + {x}^{4}\right) - 7 \cdot {x}^{3}\right) - 56 \cdot {z}^{3}\right) \cdot x\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(70 \cdot {p}^{4}\right) \cdot x\\ \end{array}\]

Reproduce

herbie shell --seed 1 
(FPCore (x y z p)
  :name "((((x*x-7*x)*x+28*pow(y,2))*x - 56*pow(z,3))*x + 70*pow(p,4))*x"
  :precision binary64
  (* (+ (* (- (* (+ (* (- (* x x) (* 7 x)) x) (* 28 (pow y 2))) x) (* 56 (pow z 3))) x) (* 70 (pow p 4))) x))