Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B

Percentage Accurate: 68.8% → 99.5%
Time: 5.9s
Alternatives: 6
Speedup: N/A×

Specification

?
\[\begin{array}{l} \\ 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} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  x
  (/
   (*
    y
    (+
     (* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
     0.279195317918525))
   (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
	return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
	return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z):
	return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z)
	return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304)))
end
function tmp = code(x, y, z)
	tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
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}
\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 6 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 68.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 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} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  x
  (/
   (*
    y
    (+
     (* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
     0.279195317918525))
   (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
double code(double x, double y, double z) {
	return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0))
end function
public static double code(double x, double y, double z) {
	return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
}
def code(x, y, z):
	return x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304))
function code(x, y, z)
	return Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304)))
end
function tmp = code(x, y, z)
	tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) / (((z + 6.012459259764103) * z) + 3.350343815022304));
end
code[x_, y_, z_] := N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
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}
\end{array}

Alternative 1: 99.5% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(0.4917317610505968 + 0.0692910599291889 \cdot z\right)\\ \mathbf{if}\;z \leq -55000000000:\\ \;\;\;\;x + \mathsf{fma}\left(\frac{y \cdot -0.07512208616047561}{z}, -1, 0.0692910599291889 \cdot y\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+14}:\\ \;\;\;\;x + \frac{y \cdot \left({t\_0}^{2} - 0.07795002554762624\right)}{\left(3.350343815022304 + z \cdot \left(6.012459259764103 + z\right)\right) \cdot \left(t\_0 - 0.279195317918525\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (+ 0.4917317610505968 (* 0.0692910599291889 z)))))
   (if (<= z -55000000000.0)
     (+ x (fma (/ (* y -0.07512208616047561) z) -1.0 (* 0.0692910599291889 y)))
     (if (<= z 1.55e+14)
       (+
        x
        (/
         (* y (- (pow t_0 2.0) 0.07795002554762624))
         (*
          (+ 3.350343815022304 (* z (+ 6.012459259764103 z)))
          (- t_0 0.279195317918525))))
       (fma 0.0692910599291889 y x)))))
double code(double x, double y, double z) {
	double t_0 = z * (0.4917317610505968 + (0.0692910599291889 * z));
	double tmp;
	if (z <= -55000000000.0) {
		tmp = x + fma(((y * -0.07512208616047561) / z), -1.0, (0.0692910599291889 * y));
	} else if (z <= 1.55e+14) {
		tmp = x + ((y * (pow(t_0, 2.0) - 0.07795002554762624)) / ((3.350343815022304 + (z * (6.012459259764103 + z))) * (t_0 - 0.279195317918525)));
	} else {
		tmp = fma(0.0692910599291889, y, x);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(z * Float64(0.4917317610505968 + Float64(0.0692910599291889 * z)))
	tmp = 0.0
	if (z <= -55000000000.0)
		tmp = Float64(x + fma(Float64(Float64(y * -0.07512208616047561) / z), -1.0, Float64(0.0692910599291889 * y)));
	elseif (z <= 1.55e+14)
		tmp = Float64(x + Float64(Float64(y * Float64((t_0 ^ 2.0) - 0.07795002554762624)) / Float64(Float64(3.350343815022304 + Float64(z * Float64(6.012459259764103 + z))) * Float64(t_0 - 0.279195317918525))));
	else
		tmp = fma(0.0692910599291889, y, x);
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(0.4917317610505968 + N[(0.0692910599291889 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -55000000000.0], N[(x + N[(N[(N[(y * -0.07512208616047561), $MachinePrecision] / z), $MachinePrecision] * -1.0 + N[(0.0692910599291889 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+14], N[(x + N[(N[(y * N[(N[Power[t$95$0, 2.0], $MachinePrecision] - 0.07795002554762624), $MachinePrecision]), $MachinePrecision] / N[(N[(3.350343815022304 + N[(z * N[(6.012459259764103 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 - 0.279195317918525), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.0692910599291889 * y + x), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \left(0.4917317610505968 + 0.0692910599291889 \cdot z\right)\\
\mathbf{if}\;z \leq -55000000000:\\
\;\;\;\;x + \mathsf{fma}\left(\frac{y \cdot -0.07512208616047561}{z}, -1, 0.0692910599291889 \cdot y\right)\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{+14}:\\
\;\;\;\;x + \frac{y \cdot \left({t\_0}^{2} - 0.07795002554762624\right)}{\left(3.350343815022304 + z \cdot \left(6.012459259764103 + z\right)\right) \cdot \left(t\_0 - 0.279195317918525\right)}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.5e10

    1. Initial program 35.3%

      \[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. Taylor expanded in z around -inf

      \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{\frac{-307332350656623}{625000000000000} \cdot y - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000} \cdot y}{z} + \frac{692910599291889}{10000000000000000} \cdot y\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto x + \left(\frac{\frac{-307332350656623}{625000000000000} \cdot y - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000} \cdot y}{z} \cdot -1 + \color{blue}{\frac{692910599291889}{10000000000000000}} \cdot y\right) \]
      2. lower-fma.f64N/A

        \[\leadsto x + \mathsf{fma}\left(\frac{\frac{-307332350656623}{625000000000000} \cdot y - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000} \cdot y}{z}, \color{blue}{-1}, \frac{692910599291889}{10000000000000000} \cdot y\right) \]
      3. lower-/.f64N/A

        \[\leadsto x + \mathsf{fma}\left(\frac{\frac{-307332350656623}{625000000000000} \cdot y - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000} \cdot y}{z}, -1, \frac{692910599291889}{10000000000000000} \cdot y\right) \]
      4. distribute-rgt-out--N/A

        \[\leadsto x + \mathsf{fma}\left(\frac{y \cdot \left(\frac{-307332350656623}{625000000000000} - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000}\right)}{z}, -1, \frac{692910599291889}{10000000000000000} \cdot y\right) \]
      5. lower-*.f64N/A

        \[\leadsto x + \mathsf{fma}\left(\frac{y \cdot \left(\frac{-307332350656623}{625000000000000} - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000}\right)}{z}, -1, \frac{692910599291889}{10000000000000000} \cdot y\right) \]
      6. metadata-evalN/A

        \[\leadsto x + \mathsf{fma}\left(\frac{y \cdot \frac{-751220861604756070699018739433}{10000000000000000000000000000000}}{z}, -1, \frac{692910599291889}{10000000000000000} \cdot y\right) \]
      7. lower-*.f6499.6

        \[\leadsto x + \mathsf{fma}\left(\frac{y \cdot -0.07512208616047561}{z}, -1, 0.0692910599291889 \cdot y\right) \]
    4. Applied rewrites99.6%

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

    if -5.5e10 < z < 1.55e14

    1. Initial program 99.6%

      \[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. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z + \frac{11167812716741}{40000000000000}\right)}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      2. lift-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\color{blue}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z} + \frac{11167812716741}{40000000000000}\right)}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      3. lift-+.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\color{blue}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right)} \cdot z + \frac{11167812716741}{40000000000000}\right)}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      4. lift-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left(\left(\color{blue}{z \cdot \frac{692910599291889}{10000000000000000}} + \frac{307332350656623}{625000000000000}\right) \cdot z + \frac{11167812716741}{40000000000000}\right)}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      5. flip-+N/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\frac{\left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z\right) \cdot \left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z\right) - \frac{11167812716741}{40000000000000} \cdot \frac{11167812716741}{40000000000000}}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      6. lower-/.f64N/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\frac{\left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z\right) \cdot \left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z\right) - \frac{11167812716741}{40000000000000} \cdot \frac{11167812716741}{40000000000000}}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      7. lower--.f64N/A

        \[\leadsto x + \frac{y \cdot \frac{\color{blue}{\left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z\right) \cdot \left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z\right) - \frac{11167812716741}{40000000000000} \cdot \frac{11167812716741}{40000000000000}}}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      8. pow2N/A

        \[\leadsto x + \frac{y \cdot \frac{\color{blue}{{\left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z\right)}^{2}} - \frac{11167812716741}{40000000000000} \cdot \frac{11167812716741}{40000000000000}}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      9. lower-pow.f64N/A

        \[\leadsto x + \frac{y \cdot \frac{\color{blue}{{\left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z\right)}^{2}} - \frac{11167812716741}{40000000000000} \cdot \frac{11167812716741}{40000000000000}}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      10. lower-*.f64N/A

        \[\leadsto x + \frac{y \cdot \frac{{\color{blue}{\left(\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z\right)}}^{2} - \frac{11167812716741}{40000000000000} \cdot \frac{11167812716741}{40000000000000}}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      11. *-commutativeN/A

        \[\leadsto x + \frac{y \cdot \frac{{\left(\left(\color{blue}{\frac{692910599291889}{10000000000000000} \cdot z} + \frac{307332350656623}{625000000000000}\right) \cdot z\right)}^{2} - \frac{11167812716741}{40000000000000} \cdot \frac{11167812716741}{40000000000000}}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      12. lower-fma.f64N/A

        \[\leadsto x + \frac{y \cdot \frac{{\left(\color{blue}{\mathsf{fma}\left(\frac{692910599291889}{10000000000000000}, z, \frac{307332350656623}{625000000000000}\right)} \cdot z\right)}^{2} - \frac{11167812716741}{40000000000000} \cdot \frac{11167812716741}{40000000000000}}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      13. metadata-evalN/A

        \[\leadsto x + \frac{y \cdot \frac{{\left(\mathsf{fma}\left(\frac{692910599291889}{10000000000000000}, z, \frac{307332350656623}{625000000000000}\right) \cdot z\right)}^{2} - \color{blue}{\frac{124720040876201995101661081}{1600000000000000000000000000}}}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      14. lower--.f64N/A

        \[\leadsto x + \frac{y \cdot \frac{{\left(\mathsf{fma}\left(\frac{692910599291889}{10000000000000000}, z, \frac{307332350656623}{625000000000000}\right) \cdot z\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}}{\color{blue}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      15. lower-*.f64N/A

        \[\leadsto x + \frac{y \cdot \frac{{\left(\mathsf{fma}\left(\frac{692910599291889}{10000000000000000}, z, \frac{307332350656623}{625000000000000}\right) \cdot z\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}}{\color{blue}{\left(z \cdot \frac{692910599291889}{10000000000000000} + \frac{307332350656623}{625000000000000}\right) \cdot z} - \frac{11167812716741}{40000000000000}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      16. *-commutativeN/A

        \[\leadsto x + \frac{y \cdot \frac{{\left(\mathsf{fma}\left(\frac{692910599291889}{10000000000000000}, z, \frac{307332350656623}{625000000000000}\right) \cdot z\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}}{\left(\color{blue}{\frac{692910599291889}{10000000000000000} \cdot z} + \frac{307332350656623}{625000000000000}\right) \cdot z - \frac{11167812716741}{40000000000000}}}{\left(z + \frac{6012459259764103}{1000000000000000}\right) \cdot z + \frac{104698244219447}{31250000000000}} \]
      17. lower-fma.f6499.3

        \[\leadsto x + \frac{y \cdot \frac{{\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right) \cdot z\right)}^{2} - 0.07795002554762624}{\color{blue}{\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right)} \cdot z - 0.279195317918525}}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    3. Applied rewrites99.3%

      \[\leadsto x + \frac{y \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right) \cdot z\right)}^{2} - 0.07795002554762624}{\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right) \cdot z - 0.279195317918525}}}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304} \]
    4. Taylor expanded in y around 0

      \[\leadsto x + \color{blue}{\frac{y \cdot \left({z}^{2} \cdot {\left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}\right)}{\left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right) \cdot \left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right) - \frac{11167812716741}{40000000000000}\right)}} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto x + \frac{y \cdot \left({z}^{2} \cdot {\left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}\right)}{\color{blue}{\left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right) \cdot \left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right) - \frac{11167812716741}{40000000000000}\right)}} \]
      2. lower-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left({z}^{2} \cdot {\left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}\right)}{\color{blue}{\left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right)} \cdot \left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right) - \frac{11167812716741}{40000000000000}\right)} \]
      3. lower--.f64N/A

        \[\leadsto x + \frac{y \cdot \left({z}^{2} \cdot {\left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}\right)}{\left(\frac{104698244219447}{31250000000000} + \color{blue}{z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)}\right) \cdot \left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right) - \frac{11167812716741}{40000000000000}\right)} \]
      4. pow-prod-downN/A

        \[\leadsto x + \frac{y \cdot \left({\left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}\right)}{\left(\frac{104698244219447}{31250000000000} + \color{blue}{z} \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right) \cdot \left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right) - \frac{11167812716741}{40000000000000}\right)} \]
      5. lower-pow.f64N/A

        \[\leadsto x + \frac{y \cdot \left({\left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}\right)}{\left(\frac{104698244219447}{31250000000000} + \color{blue}{z} \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right) \cdot \left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right) - \frac{11167812716741}{40000000000000}\right)} \]
      6. lower-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left({\left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}\right)}{\left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right) \cdot \left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right) - \frac{11167812716741}{40000000000000}\right)} \]
      7. lower-+.f64N/A

        \[\leadsto x + \frac{y \cdot \left({\left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}\right)}{\left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right) \cdot \left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right) - \frac{11167812716741}{40000000000000}\right)} \]
      8. lower-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left({\left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}\right)}{\left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right) \cdot \left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right) - \frac{11167812716741}{40000000000000}\right)} \]
      9. lower-*.f64N/A

        \[\leadsto x + \frac{y \cdot \left({\left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)\right)}^{2} - \frac{124720040876201995101661081}{1600000000000000000000000000}\right)}{\left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right) \cdot \color{blue}{\left(z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right) - \frac{11167812716741}{40000000000000}\right)}} \]
    6. Applied rewrites99.5%

      \[\leadsto x + \color{blue}{\frac{y \cdot \left({\left(z \cdot \left(0.4917317610505968 + 0.0692910599291889 \cdot z\right)\right)}^{2} - 0.07795002554762624\right)}{\left(3.350343815022304 + z \cdot \left(6.012459259764103 + z\right)\right) \cdot \left(z \cdot \left(0.4917317610505968 + 0.0692910599291889 \cdot z\right) - 0.279195317918525\right)}} \]

    if 1.55e14 < z

    1. Initial program 35.6%

      \[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. Taylor expanded in z around inf

      \[\leadsto \color{blue}{x + \frac{692910599291889}{10000000000000000} \cdot y} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{692910599291889}{10000000000000000} \cdot y + \color{blue}{x} \]
      2. lower-fma.f6499.6

        \[\leadsto \mathsf{fma}\left(0.0692910599291889, \color{blue}{y}, x\right) \]
    4. Applied rewrites99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.0692910599291889, y, x\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 99.0% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \mathsf{fma}\left(\frac{y \cdot -0.07512208616047561}{z}, -1, 0.0692910599291889 \cdot y\right)\\ \mathbf{if}\;z \leq -3700:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 3.35 \cdot 10^{-6}:\\ \;\;\;\;x + 0.08333333333333323 \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          x
          (fma
           (/ (* y -0.07512208616047561) z)
           -1.0
           (* 0.0692910599291889 y)))))
   (if (<= z -3700.0)
     t_0
     (if (<= z 3.35e-6) (+ x (* 0.08333333333333323 y)) t_0))))
double code(double x, double y, double z) {
	double t_0 = x + fma(((y * -0.07512208616047561) / z), -1.0, (0.0692910599291889 * y));
	double tmp;
	if (z <= -3700.0) {
		tmp = t_0;
	} else if (z <= 3.35e-6) {
		tmp = x + (0.08333333333333323 * y);
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(x + fma(Float64(Float64(y * -0.07512208616047561) / z), -1.0, Float64(0.0692910599291889 * y)))
	tmp = 0.0
	if (z <= -3700.0)
		tmp = t_0;
	elseif (z <= 3.35e-6)
		tmp = Float64(x + Float64(0.08333333333333323 * y));
	else
		tmp = t_0;
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(N[(N[(y * -0.07512208616047561), $MachinePrecision] / z), $MachinePrecision] * -1.0 + N[(0.0692910599291889 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3700.0], t$95$0, If[LessEqual[z, 3.35e-6], N[(x + N[(0.08333333333333323 * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x + \mathsf{fma}\left(\frac{y \cdot -0.07512208616047561}{z}, -1, 0.0692910599291889 \cdot y\right)\\
\mathbf{if}\;z \leq -3700:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 3.35 \cdot 10^{-6}:\\
\;\;\;\;x + 0.08333333333333323 \cdot y\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3700 or 3.35e-6 < z

    1. Initial program 37.9%

      \[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. Taylor expanded in z around -inf

      \[\leadsto x + \color{blue}{\left(-1 \cdot \frac{\frac{-307332350656623}{625000000000000} \cdot y - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000} \cdot y}{z} + \frac{692910599291889}{10000000000000000} \cdot y\right)} \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto x + \left(\frac{\frac{-307332350656623}{625000000000000} \cdot y - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000} \cdot y}{z} \cdot -1 + \color{blue}{\frac{692910599291889}{10000000000000000}} \cdot y\right) \]
      2. lower-fma.f64N/A

        \[\leadsto x + \mathsf{fma}\left(\frac{\frac{-307332350656623}{625000000000000} \cdot y - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000} \cdot y}{z}, \color{blue}{-1}, \frac{692910599291889}{10000000000000000} \cdot y\right) \]
      3. lower-/.f64N/A

        \[\leadsto x + \mathsf{fma}\left(\frac{\frac{-307332350656623}{625000000000000} \cdot y - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000} \cdot y}{z}, -1, \frac{692910599291889}{10000000000000000} \cdot y\right) \]
      4. distribute-rgt-out--N/A

        \[\leadsto x + \mathsf{fma}\left(\frac{y \cdot \left(\frac{-307332350656623}{625000000000000} - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000}\right)}{z}, -1, \frac{692910599291889}{10000000000000000} \cdot y\right) \]
      5. lower-*.f64N/A

        \[\leadsto x + \mathsf{fma}\left(\frac{y \cdot \left(\frac{-307332350656623}{625000000000000} - \frac{-4166096748901211929300981260567}{10000000000000000000000000000000}\right)}{z}, -1, \frac{692910599291889}{10000000000000000} \cdot y\right) \]
      6. metadata-evalN/A

        \[\leadsto x + \mathsf{fma}\left(\frac{y \cdot \frac{-751220861604756070699018739433}{10000000000000000000000000000000}}{z}, -1, \frac{692910599291889}{10000000000000000} \cdot y\right) \]
      7. lower-*.f6498.9

        \[\leadsto x + \mathsf{fma}\left(\frac{y \cdot -0.07512208616047561}{z}, -1, 0.0692910599291889 \cdot y\right) \]
    4. Applied rewrites98.9%

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

    if -3700 < z < 3.35e-6

    1. Initial program 99.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. Taylor expanded in z around 0

      \[\leadsto x + \color{blue}{\frac{279195317918525}{3350343815022304} \cdot y} \]
    3. Step-by-step derivation
      1. lower-*.f6499.0

        \[\leadsto x + 0.08333333333333323 \cdot \color{blue}{y} \]
    4. Applied rewrites99.0%

      \[\leadsto x + \color{blue}{0.08333333333333323 \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 98.8% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3700:\\ \;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\ \mathbf{elif}\;z \leq 3.35 \cdot 10^{-6}:\\ \;\;\;\;x + 0.08333333333333323 \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -3700.0)
   (fma 0.0692910599291889 y x)
   (if (<= z 3.35e-6)
     (+ x (* 0.08333333333333323 y))
     (fma 0.0692910599291889 y x))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -3700.0) {
		tmp = fma(0.0692910599291889, y, x);
	} else if (z <= 3.35e-6) {
		tmp = x + (0.08333333333333323 * y);
	} else {
		tmp = fma(0.0692910599291889, y, x);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -3700.0)
		tmp = fma(0.0692910599291889, y, x);
	elseif (z <= 3.35e-6)
		tmp = Float64(x + Float64(0.08333333333333323 * y));
	else
		tmp = fma(0.0692910599291889, y, x);
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -3700.0], N[(0.0692910599291889 * y + x), $MachinePrecision], If[LessEqual[z, 3.35e-6], N[(x + N[(0.08333333333333323 * y), $MachinePrecision]), $MachinePrecision], N[(0.0692910599291889 * y + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3700:\\
\;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\

\mathbf{elif}\;z \leq 3.35 \cdot 10^{-6}:\\
\;\;\;\;x + 0.08333333333333323 \cdot y\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3700 or 3.35e-6 < z

    1. Initial program 37.9%

      \[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. Taylor expanded in z around inf

      \[\leadsto \color{blue}{x + \frac{692910599291889}{10000000000000000} \cdot y} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{692910599291889}{10000000000000000} \cdot y + \color{blue}{x} \]
      2. lower-fma.f6498.5

        \[\leadsto \mathsf{fma}\left(0.0692910599291889, \color{blue}{y}, x\right) \]
    4. Applied rewrites98.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.0692910599291889, y, x\right)} \]

    if -3700 < z < 3.35e-6

    1. Initial program 99.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. Taylor expanded in z around 0

      \[\leadsto x + \color{blue}{\frac{279195317918525}{3350343815022304} \cdot y} \]
    3. Step-by-step derivation
      1. lower-*.f6499.0

        \[\leadsto x + 0.08333333333333323 \cdot \color{blue}{y} \]
    4. Applied rewrites99.0%

      \[\leadsto x + \color{blue}{0.08333333333333323 \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 93.4% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2\\ \mathbf{if}\;z \leq -2.8 \cdot 10^{+16}:\\ \;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\ \mathbf{elif}\;z \leq 52000000000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right), z, 0.279195317918525\right) \cdot y}{x}, 2, t\_0\right)}{t\_0} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (fma (+ 6.012459259764103 z) z 3.350343815022304) 2.0)))
   (if (<= z -2.8e+16)
     (fma 0.0692910599291889 y x)
     (if (<= z 52000000000000.0)
       (*
        (/
         (fma
          (/
           (*
            (fma
             (fma 0.0692910599291889 z 0.4917317610505968)
             z
             0.279195317918525)
            y)
           x)
          2.0
          t_0)
         t_0)
        x)
       (fma 0.0692910599291889 y x)))))
double code(double x, double y, double z) {
	double t_0 = fma((6.012459259764103 + z), z, 3.350343815022304) * 2.0;
	double tmp;
	if (z <= -2.8e+16) {
		tmp = fma(0.0692910599291889, y, x);
	} else if (z <= 52000000000000.0) {
		tmp = (fma(((fma(fma(0.0692910599291889, z, 0.4917317610505968), z, 0.279195317918525) * y) / x), 2.0, t_0) / t_0) * x;
	} else {
		tmp = fma(0.0692910599291889, y, x);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(fma(Float64(6.012459259764103 + z), z, 3.350343815022304) * 2.0)
	tmp = 0.0
	if (z <= -2.8e+16)
		tmp = fma(0.0692910599291889, y, x);
	elseif (z <= 52000000000000.0)
		tmp = Float64(Float64(fma(Float64(Float64(fma(fma(0.0692910599291889, z, 0.4917317610505968), z, 0.279195317918525) * y) / x), 2.0, t_0) / t_0) * x);
	else
		tmp = fma(0.0692910599291889, y, x);
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(6.012459259764103 + z), $MachinePrecision] * z + 3.350343815022304), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[z, -2.8e+16], N[(0.0692910599291889 * y + x), $MachinePrecision], If[LessEqual[z, 52000000000000.0], N[(N[(N[(N[(N[(N[(N[(0.0692910599291889 * z + 0.4917317610505968), $MachinePrecision] * z + 0.279195317918525), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision] * 2.0 + t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] * x), $MachinePrecision], N[(0.0692910599291889 * y + x), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\

\mathbf{elif}\;z \leq 52000000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right), z, 0.279195317918525\right) \cdot y}{x}, 2, t\_0\right)}{t\_0} \cdot x\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.0692910599291889, y, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.8e16 or 5.2e13 < z

    1. Initial program 35.0%

      \[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. Taylor expanded in z around inf

      \[\leadsto \color{blue}{x + \frac{692910599291889}{10000000000000000} \cdot y} \]
    3. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{692910599291889}{10000000000000000} \cdot y + \color{blue}{x} \]
      2. lower-fma.f6499.6

        \[\leadsto \mathsf{fma}\left(0.0692910599291889, \color{blue}{y}, x\right) \]
    4. Applied rewrites99.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.0692910599291889, y, x\right)} \]

    if -2.8e16 < z < 5.2e13

    1. Initial program 99.6%

      \[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. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(1 + \frac{y \cdot \left(\frac{11167812716741}{40000000000000} + z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)\right)}{x \cdot \left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right)}\right)} \]
    3. Applied rewrites87.9%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right), z, 0.279195317918525\right) \cdot y}{x}, 2, \mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2\right)}{\mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2} \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 86.8% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(0.1385821198583778, \frac{y}{x}, 2\right)\\ t_1 := \mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2\\ t_2 := \mathsf{fma}\left(\frac{\mathsf{fma}\left(0.9834635221011936, \frac{y}{x}, 12.024918519528207\right)}{z} - \frac{t\_0 \cdot 6.012459259764103}{z}, 0.5, t\_0 \cdot 0.5\right) \cdot x\\ \mathbf{if}\;z \leq -2 \cdot 10^{+53}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 3.35 \cdot 10^{-6}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right), z, 0.279195317918525\right) \cdot y}{x}, 2, t\_1\right)}{t\_1} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (fma 0.1385821198583778 (/ y x) 2.0))
        (t_1 (* (fma (+ 6.012459259764103 z) z 3.350343815022304) 2.0))
        (t_2
         (*
          (fma
           (-
            (/ (fma 0.9834635221011936 (/ y x) 12.024918519528207) z)
            (/ (* t_0 6.012459259764103) z))
           0.5
           (* t_0 0.5))
          x)))
   (if (<= z -2e+53)
     t_2
     (if (<= z 3.35e-6)
       (*
        (/
         (fma
          (/
           (*
            (fma
             (fma 0.0692910599291889 z 0.4917317610505968)
             z
             0.279195317918525)
            y)
           x)
          2.0
          t_1)
         t_1)
        x)
       t_2))))
double code(double x, double y, double z) {
	double t_0 = fma(0.1385821198583778, (y / x), 2.0);
	double t_1 = fma((6.012459259764103 + z), z, 3.350343815022304) * 2.0;
	double t_2 = fma(((fma(0.9834635221011936, (y / x), 12.024918519528207) / z) - ((t_0 * 6.012459259764103) / z)), 0.5, (t_0 * 0.5)) * x;
	double tmp;
	if (z <= -2e+53) {
		tmp = t_2;
	} else if (z <= 3.35e-6) {
		tmp = (fma(((fma(fma(0.0692910599291889, z, 0.4917317610505968), z, 0.279195317918525) * y) / x), 2.0, t_1) / t_1) * x;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z)
	t_0 = fma(0.1385821198583778, Float64(y / x), 2.0)
	t_1 = Float64(fma(Float64(6.012459259764103 + z), z, 3.350343815022304) * 2.0)
	t_2 = Float64(fma(Float64(Float64(fma(0.9834635221011936, Float64(y / x), 12.024918519528207) / z) - Float64(Float64(t_0 * 6.012459259764103) / z)), 0.5, Float64(t_0 * 0.5)) * x)
	tmp = 0.0
	if (z <= -2e+53)
		tmp = t_2;
	elseif (z <= 3.35e-6)
		tmp = Float64(Float64(fma(Float64(Float64(fma(fma(0.0692910599291889, z, 0.4917317610505968), z, 0.279195317918525) * y) / x), 2.0, t_1) / t_1) * x);
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.1385821198583778 * N[(y / x), $MachinePrecision] + 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(6.012459259764103 + z), $MachinePrecision] * z + 3.350343815022304), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(0.9834635221011936 * N[(y / x), $MachinePrecision] + 12.024918519528207), $MachinePrecision] / z), $MachinePrecision] - N[(N[(t$95$0 * 6.012459259764103), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(t$95$0 * 0.5), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -2e+53], t$95$2, If[LessEqual[z, 3.35e-6], N[(N[(N[(N[(N[(N[(N[(0.0692910599291889 * z + 0.4917317610505968), $MachinePrecision] * z + 0.279195317918525), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision] * 2.0 + t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.1385821198583778, \frac{y}{x}, 2\right)\\
t_1 := \mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2\\
t_2 := \mathsf{fma}\left(\frac{\mathsf{fma}\left(0.9834635221011936, \frac{y}{x}, 12.024918519528207\right)}{z} - \frac{t\_0 \cdot 6.012459259764103}{z}, 0.5, t\_0 \cdot 0.5\right) \cdot x\\
\mathbf{if}\;z \leq -2 \cdot 10^{+53}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 3.35 \cdot 10^{-6}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right), z, 0.279195317918525\right) \cdot y}{x}, 2, t\_1\right)}{t\_1} \cdot x\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2e53 or 3.35e-6 < z

    1. Initial program 33.6%

      \[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. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(1 + \frac{y \cdot \left(\frac{11167812716741}{40000000000000} + z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)\right)}{x \cdot \left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right)}\right)} \]
    3. Applied rewrites28.1%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right), z, 0.279195317918525\right) \cdot y}{x}, 2, \mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2\right)}{\mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2} \cdot x} \]
    4. Taylor expanded in z around inf

      \[\leadsto \left(\frac{1}{2} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right) + \frac{1}{2} \cdot \frac{\left(\frac{6012459259764103}{500000000000000} + \frac{307332350656623}{312500000000000} \cdot \frac{y}{x}\right) - \frac{6012459259764103}{1000000000000000} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)}{z}\right) \cdot x \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(\frac{1}{2} \cdot \frac{\left(\frac{6012459259764103}{500000000000000} + \frac{307332350656623}{312500000000000} \cdot \frac{y}{x}\right) - \frac{6012459259764103}{1000000000000000} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)}{z} + \frac{1}{2} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)\right) \cdot x \]
      2. *-commutativeN/A

        \[\leadsto \left(\frac{\left(\frac{6012459259764103}{500000000000000} + \frac{307332350656623}{312500000000000} \cdot \frac{y}{x}\right) - \frac{6012459259764103}{1000000000000000} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)}{z} \cdot \frac{1}{2} + \frac{1}{2} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)\right) \cdot x \]
      3. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{\left(\frac{6012459259764103}{500000000000000} + \frac{307332350656623}{312500000000000} \cdot \frac{y}{x}\right) - \frac{6012459259764103}{1000000000000000} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)}{z}, \frac{1}{2}, \frac{1}{2} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)\right) \cdot x \]
    6. Applied rewrites85.8%

      \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(0.9834635221011936, \frac{y}{x}, 12.024918519528207\right)}{z} - \frac{\mathsf{fma}\left(0.1385821198583778, \frac{y}{x}, 2\right) \cdot 6.012459259764103}{z}, 0.5, \mathsf{fma}\left(0.1385821198583778, \frac{y}{x}, 2\right) \cdot 0.5\right) \cdot x \]

    if -2e53 < z < 3.35e-6

    1. Initial program 99.3%

      \[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. Taylor expanded in x around inf

      \[\leadsto \color{blue}{x \cdot \left(1 + \frac{y \cdot \left(\frac{11167812716741}{40000000000000} + z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)\right)}{x \cdot \left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right)}\right)} \]
    3. Applied rewrites87.6%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right), z, 0.279195317918525\right) \cdot y}{x}, 2, \mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2\right)}{\mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2} \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 67.1% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(0.1385821198583778, \frac{y}{x}, 2\right)\\ \mathsf{fma}\left(\frac{\mathsf{fma}\left(0.9834635221011936, \frac{y}{x}, 12.024918519528207\right)}{z} - \frac{t\_0 \cdot 6.012459259764103}{z}, 0.5, t\_0 \cdot 0.5\right) \cdot x \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (fma 0.1385821198583778 (/ y x) 2.0)))
   (*
    (fma
     (-
      (/ (fma 0.9834635221011936 (/ y x) 12.024918519528207) z)
      (/ (* t_0 6.012459259764103) z))
     0.5
     (* t_0 0.5))
    x)))
double code(double x, double y, double z) {
	double t_0 = fma(0.1385821198583778, (y / x), 2.0);
	return fma(((fma(0.9834635221011936, (y / x), 12.024918519528207) / z) - ((t_0 * 6.012459259764103) / z)), 0.5, (t_0 * 0.5)) * x;
}
function code(x, y, z)
	t_0 = fma(0.1385821198583778, Float64(y / x), 2.0)
	return Float64(fma(Float64(Float64(fma(0.9834635221011936, Float64(y / x), 12.024918519528207) / z) - Float64(Float64(t_0 * 6.012459259764103) / z)), 0.5, Float64(t_0 * 0.5)) * x)
end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.1385821198583778 * N[(y / x), $MachinePrecision] + 2.0), $MachinePrecision]}, N[(N[(N[(N[(N[(0.9834635221011936 * N[(y / x), $MachinePrecision] + 12.024918519528207), $MachinePrecision] / z), $MachinePrecision] - N[(N[(t$95$0 * 6.012459259764103), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(t$95$0 * 0.5), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.1385821198583778, \frac{y}{x}, 2\right)\\
\mathsf{fma}\left(\frac{\mathsf{fma}\left(0.9834635221011936, \frac{y}{x}, 12.024918519528207\right)}{z} - \frac{t\_0 \cdot 6.012459259764103}{z}, 0.5, t\_0 \cdot 0.5\right) \cdot x
\end{array}
\end{array}
Derivation
  1. Initial program 68.8%

    \[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. Taylor expanded in x around inf

    \[\leadsto \color{blue}{x \cdot \left(1 + \frac{y \cdot \left(\frac{11167812716741}{40000000000000} + z \cdot \left(\frac{307332350656623}{625000000000000} + \frac{692910599291889}{10000000000000000} \cdot z\right)\right)}{x \cdot \left(\frac{104698244219447}{31250000000000} + z \cdot \left(\frac{6012459259764103}{1000000000000000} + z\right)\right)}\right)} \]
  3. Applied rewrites60.0%

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.0692910599291889, z, 0.4917317610505968\right), z, 0.279195317918525\right) \cdot y}{x}, 2, \mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2\right)}{\mathsf{fma}\left(6.012459259764103 + z, z, 3.350343815022304\right) \cdot 2} \cdot x} \]
  4. Taylor expanded in z around inf

    \[\leadsto \left(\frac{1}{2} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right) + \frac{1}{2} \cdot \frac{\left(\frac{6012459259764103}{500000000000000} + \frac{307332350656623}{312500000000000} \cdot \frac{y}{x}\right) - \frac{6012459259764103}{1000000000000000} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)}{z}\right) \cdot x \]
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \left(\frac{1}{2} \cdot \frac{\left(\frac{6012459259764103}{500000000000000} + \frac{307332350656623}{312500000000000} \cdot \frac{y}{x}\right) - \frac{6012459259764103}{1000000000000000} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)}{z} + \frac{1}{2} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)\right) \cdot x \]
    2. *-commutativeN/A

      \[\leadsto \left(\frac{\left(\frac{6012459259764103}{500000000000000} + \frac{307332350656623}{312500000000000} \cdot \frac{y}{x}\right) - \frac{6012459259764103}{1000000000000000} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)}{z} \cdot \frac{1}{2} + \frac{1}{2} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)\right) \cdot x \]
    3. lower-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(\frac{\left(\frac{6012459259764103}{500000000000000} + \frac{307332350656623}{312500000000000} \cdot \frac{y}{x}\right) - \frac{6012459259764103}{1000000000000000} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)}{z}, \frac{1}{2}, \frac{1}{2} \cdot \left(2 + \frac{692910599291889}{5000000000000000} \cdot \frac{y}{x}\right)\right) \cdot x \]
  6. Applied rewrites67.1%

    \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(0.9834635221011936, \frac{y}{x}, 12.024918519528207\right)}{z} - \frac{\mathsf{fma}\left(0.1385821198583778, \frac{y}{x}, 2\right) \cdot 6.012459259764103}{z}, 0.5, \mathsf{fma}\left(0.1385821198583778, \frac{y}{x}, 2\right) \cdot 0.5\right) \cdot x \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2025093 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"
  :precision binary64
  (+ x (/ (* y (+ (* (+ (* z 0.0692910599291889) 0.4917317610505968) z) 0.279195317918525)) (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))