Average Error: 20.2 → 0.1
Time: 53.1s
Precision: 64
\[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}\]
\[\begin{array}{l} \mathbf{if}\;z \le -47430921588347.03:\\ \;\;\;\;\left(y \cdot 0.0692910599291889 + \left(\frac{0.07512208616047561}{\frac{z}{y}} - \frac{y}{z} \cdot \frac{0.40462203869992125}{z}\right)\right) + x\\ \mathbf{elif}\;z \le 23415.342663009633:\\ \;\;\;\;\frac{\frac{0.279195317918525 + \left(0.4917317610505968 + 0.0692910599291889 \cdot z\right) \cdot z}{\sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}}}{\sqrt[3]{\left(\sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304} \cdot \sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}\right) \cdot \sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}}} \cdot y + x\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot 0.0692910599291889 + \left(\frac{0.07512208616047561}{\frac{z}{y}} - \frac{y}{z} \cdot \frac{0.40462203869992125}{z}\right)\right) + x\\ \end{array}\]
x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}
\begin{array}{l}
\mathbf{if}\;z \le -47430921588347.03:\\
\;\;\;\;\left(y \cdot 0.0692910599291889 + \left(\frac{0.07512208616047561}{\frac{z}{y}} - \frac{y}{z} \cdot \frac{0.40462203869992125}{z}\right)\right) + x\\

\mathbf{elif}\;z \le 23415.342663009633:\\
\;\;\;\;\frac{\frac{0.279195317918525 + \left(0.4917317610505968 + 0.0692910599291889 \cdot z\right) \cdot z}{\sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}}}{\sqrt[3]{\left(\sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304} \cdot \sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}\right) \cdot \sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}}} \cdot y + x\\

\mathbf{else}:\\
\;\;\;\;\left(y \cdot 0.0692910599291889 + \left(\frac{0.07512208616047561}{\frac{z}{y}} - \frac{y}{z} \cdot \frac{0.40462203869992125}{z}\right)\right) + x\\

\end{array}
double f(double x, double y, double z) {
        double r22359206 = x;
        double r22359207 = y;
        double r22359208 = z;
        double r22359209 = 0.0692910599291889;
        double r22359210 = r22359208 * r22359209;
        double r22359211 = 0.4917317610505968;
        double r22359212 = r22359210 + r22359211;
        double r22359213 = r22359212 * r22359208;
        double r22359214 = 0.279195317918525;
        double r22359215 = r22359213 + r22359214;
        double r22359216 = r22359207 * r22359215;
        double r22359217 = 6.012459259764103;
        double r22359218 = r22359208 + r22359217;
        double r22359219 = r22359218 * r22359208;
        double r22359220 = 3.350343815022304;
        double r22359221 = r22359219 + r22359220;
        double r22359222 = r22359216 / r22359221;
        double r22359223 = r22359206 + r22359222;
        return r22359223;
}

double f(double x, double y, double z) {
        double r22359224 = z;
        double r22359225 = -47430921588347.03;
        bool r22359226 = r22359224 <= r22359225;
        double r22359227 = y;
        double r22359228 = 0.0692910599291889;
        double r22359229 = r22359227 * r22359228;
        double r22359230 = 0.07512208616047561;
        double r22359231 = r22359224 / r22359227;
        double r22359232 = r22359230 / r22359231;
        double r22359233 = r22359227 / r22359224;
        double r22359234 = 0.40462203869992125;
        double r22359235 = r22359234 / r22359224;
        double r22359236 = r22359233 * r22359235;
        double r22359237 = r22359232 - r22359236;
        double r22359238 = r22359229 + r22359237;
        double r22359239 = x;
        double r22359240 = r22359238 + r22359239;
        double r22359241 = 23415.342663009633;
        bool r22359242 = r22359224 <= r22359241;
        double r22359243 = 0.279195317918525;
        double r22359244 = 0.4917317610505968;
        double r22359245 = r22359228 * r22359224;
        double r22359246 = r22359244 + r22359245;
        double r22359247 = r22359246 * r22359224;
        double r22359248 = r22359243 + r22359247;
        double r22359249 = 6.012459259764103;
        double r22359250 = r22359249 + r22359224;
        double r22359251 = r22359224 * r22359250;
        double r22359252 = 3.350343815022304;
        double r22359253 = r22359251 + r22359252;
        double r22359254 = sqrt(r22359253);
        double r22359255 = r22359248 / r22359254;
        double r22359256 = r22359254 * r22359254;
        double r22359257 = r22359256 * r22359254;
        double r22359258 = cbrt(r22359257);
        double r22359259 = r22359255 / r22359258;
        double r22359260 = r22359259 * r22359227;
        double r22359261 = r22359260 + r22359239;
        double r22359262 = r22359242 ? r22359261 : r22359240;
        double r22359263 = r22359226 ? r22359240 : r22359262;
        return r22359263;
}

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

Target

Original20.2
Target0.1
Herbie0.1
\[\begin{array}{l} \mathbf{if}\;z \lt -8120153.652456675:\\ \;\;\;\;\left(\frac{0.07512208616047561}{z} + 0.0692910599291889\right) \cdot y - \left(\frac{0.40462203869992125 \cdot y}{z \cdot z} - x\right)\\ \mathbf{elif}\;z \lt 6.576118972787377 \cdot 10^{+20}:\\ \;\;\;\;x + \left(y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)\right) \cdot \frac{1.0}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{0.07512208616047561}{z} + 0.0692910599291889\right) \cdot y - \left(\frac{0.40462203869992125 \cdot y}{z \cdot z} - x\right)\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -47430921588347.03 or 23415.342663009633 < z

    1. Initial program 41.7

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt41.7

      \[\leadsto x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\color{blue}{\sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \cdot \sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}}}\]
    4. Applied times-frac33.5

      \[\leadsto x + \color{blue}{\frac{y}{\sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}} \cdot \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}}}\]
    5. Taylor expanded around inf 0.0

      \[\leadsto x + \color{blue}{\left(\left(0.0692910599291889 \cdot y + 0.07512208616047561 \cdot \frac{y}{z}\right) - 0.40462203869992125 \cdot \frac{y}{{z}^{2}}\right)}\]
    6. Simplified0.0

      \[\leadsto x + \color{blue}{\left(\left(\frac{0.07512208616047561}{\frac{z}{y}} - \frac{y}{z} \cdot \frac{0.40462203869992125}{z}\right) + 0.0692910599291889 \cdot y\right)}\]

    if -47430921588347.03 < z < 23415.342663009633

    1. Initial program 0.2

      \[x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt0.5

      \[\leadsto x + \frac{y \cdot \left(\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525\right)}{\color{blue}{\sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \cdot \sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}}}\]
    4. Applied times-frac0.3

      \[\leadsto x + \color{blue}{\frac{y}{\sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}} \cdot \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}}}\]
    5. Using strategy rm
    6. Applied div-inv0.3

      \[\leadsto x + \color{blue}{\left(y \cdot \frac{1}{\sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}}\right)} \cdot \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}}\]
    7. Applied associate-*l*0.2

      \[\leadsto x + \color{blue}{y \cdot \left(\frac{1}{\sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}} \cdot \frac{\left(z \cdot 0.0692910599291889 + 0.4917317610505968\right) \cdot z + 0.279195317918525}{\sqrt{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}}\right)}\]
    8. Simplified0.2

      \[\leadsto x + y \cdot \color{blue}{\frac{\frac{z \cdot \left(0.0692910599291889 \cdot z + 0.4917317610505968\right) + 0.279195317918525}{\sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}}}{\sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}}}\]
    9. Using strategy rm
    10. Applied add-cbrt-cube0.3

      \[\leadsto x + y \cdot \frac{\frac{z \cdot \left(0.0692910599291889 \cdot z + 0.4917317610505968\right) + 0.279195317918525}{\sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}}}{\color{blue}{\sqrt[3]{\left(\sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304} \cdot \sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}\right) \cdot \sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -47430921588347.03:\\ \;\;\;\;\left(y \cdot 0.0692910599291889 + \left(\frac{0.07512208616047561}{\frac{z}{y}} - \frac{y}{z} \cdot \frac{0.40462203869992125}{z}\right)\right) + x\\ \mathbf{elif}\;z \le 23415.342663009633:\\ \;\;\;\;\frac{\frac{0.279195317918525 + \left(0.4917317610505968 + 0.0692910599291889 \cdot z\right) \cdot z}{\sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}}}{\sqrt[3]{\left(\sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304} \cdot \sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}\right) \cdot \sqrt{z \cdot \left(6.012459259764103 + z\right) + 3.350343815022304}}} \cdot y + x\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot 0.0692910599291889 + \left(\frac{0.07512208616047561}{\frac{z}{y}} - \frac{y}{z} \cdot \frac{0.40462203869992125}{z}\right)\right) + x\\ \end{array}\]

Reproduce

herbie shell --seed 2019165 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"

  :herbie-target
  (if (< z -8120153.652456675) (- (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y) (- (/ (* 0.40462203869992125 y) (* z z)) x)) (if (< z 6.576118972787377e+20) (+ x (* (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (/ 1.0 (+ (* (+ z 6.012459259764103) z) 3.350343815022304)))) (- (* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y) (- (/ (* 0.40462203869992125 y) (* z z)) x))))

  (+ x (/ (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))