
(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));
}
real(8) function code(x, y, z)
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}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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));
}
real(8) function code(x, y, z)
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}
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
y
(+
(* z (+ 0.4917317610505968 (* z 0.0692910599291889)))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
INFINITY)
(fma
y
(/
(fma z (fma z 0.0692910599291889 0.4917317610505968) 0.279195317918525)
(fma z (+ z 6.012459259764103) 3.350343815022304))
x)
(+ x (* y 0.0692910599291889))))
double code(double x, double y, double z) {
double tmp;
if (((y * ((z * (0.4917317610505968 + (z * 0.0692910599291889))) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) <= ((double) INFINITY)) {
tmp = fma(y, (fma(z, fma(z, 0.0692910599291889, 0.4917317610505968), 0.279195317918525) / fma(z, (z + 6.012459259764103), 3.350343815022304)), x);
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(y * Float64(Float64(z * Float64(0.4917317610505968 + Float64(z * 0.0692910599291889))) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) <= Inf) tmp = fma(y, Float64(fma(z, fma(z, 0.0692910599291889, 0.4917317610505968), 0.279195317918525) / fma(z, Float64(z + 6.012459259764103), 3.350343815022304)), x); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(y * N[(N[(z * N[(0.4917317610505968 + N[(z * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision], Infinity], N[(y * N[(N[(z * N[(z * 0.0692910599291889 + 0.4917317610505968), $MachinePrecision] + 0.279195317918525), $MachinePrecision] / N[(z * N[(z + 6.012459259764103), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z \cdot \left(0.4917317610505968 + z \cdot 0.0692910599291889\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, 0.0692910599291889, 0.4917317610505968\right), 0.279195317918525\right)}{\mathsf{fma}\left(z, z + 6.012459259764103, 3.350343815022304\right)}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ (* z (+ z 6.012459259764103)) 3.350343815022304))
(t_1 (* z (+ 0.4917317610505968 (* z 0.0692910599291889)))))
(if (<= (/ (* y (+ t_1 0.279195317918525)) t_0) INFINITY)
(+ x (* y (+ (* 0.279195317918525 (/ 1.0 t_0)) (/ t_1 t_0))))
(+ x (* y 0.0692910599291889)))))
double code(double x, double y, double z) {
double t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304;
double t_1 = z * (0.4917317610505968 + (z * 0.0692910599291889));
double tmp;
if (((y * (t_1 + 0.279195317918525)) / t_0) <= ((double) INFINITY)) {
tmp = x + (y * ((0.279195317918525 * (1.0 / t_0)) + (t_1 / t_0)));
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304;
double t_1 = z * (0.4917317610505968 + (z * 0.0692910599291889));
double tmp;
if (((y * (t_1 + 0.279195317918525)) / t_0) <= Double.POSITIVE_INFINITY) {
tmp = x + (y * ((0.279195317918525 * (1.0 / t_0)) + (t_1 / t_0)));
} else {
tmp = x + (y * 0.0692910599291889);
}
return tmp;
}
def code(x, y, z): t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304 t_1 = z * (0.4917317610505968 + (z * 0.0692910599291889)) tmp = 0 if ((y * (t_1 + 0.279195317918525)) / t_0) <= math.inf: tmp = x + (y * ((0.279195317918525 * (1.0 / t_0)) + (t_1 / t_0))) else: tmp = x + (y * 0.0692910599291889) return tmp
function code(x, y, z) t_0 = Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304) t_1 = Float64(z * Float64(0.4917317610505968 + Float64(z * 0.0692910599291889))) tmp = 0.0 if (Float64(Float64(y * Float64(t_1 + 0.279195317918525)) / t_0) <= Inf) tmp = Float64(x + Float64(y * Float64(Float64(0.279195317918525 * Float64(1.0 / t_0)) + Float64(t_1 / t_0)))); else tmp = Float64(x + Float64(y * 0.0692910599291889)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (z * (z + 6.012459259764103)) + 3.350343815022304; t_1 = z * (0.4917317610505968 + (z * 0.0692910599291889)); tmp = 0.0; if (((y * (t_1 + 0.279195317918525)) / t_0) <= Inf) tmp = x + (y * ((0.279195317918525 * (1.0 / t_0)) + (t_1 / t_0))); else tmp = x + (y * 0.0692910599291889); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(0.4917317610505968 + N[(z * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(y * N[(t$95$1 + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], Infinity], N[(x + N[(y * N[(N[(0.279195317918525 * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304\\
t_1 := z \cdot \left(0.4917317610505968 + z \cdot 0.0692910599291889\right)\\
\mathbf{if}\;\frac{y \cdot \left(t_1 + 0.279195317918525\right)}{t_0} \leq \infty:\\
\;\;\;\;x + y \cdot \left(0.279195317918525 \cdot \frac{1}{t_0} + \frac{t_1}{t_0}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(if (or (<= z -400000000.0) (not (<= z 55000000.0)))
(+ x (- (* y 0.0692910599291889) (/ (* y -0.07512208616047561) z)))
(+
(/
(*
y
(+
(* z (+ 0.4917317610505968 (* z 0.0692910599291889)))
0.279195317918525))
(+ (* z (+ z 6.012459259764103)) 3.350343815022304))
x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -400000000.0) || !(z <= 55000000.0)) {
tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z));
} else {
tmp = ((y * ((z * (0.4917317610505968 + (z * 0.0692910599291889))) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-400000000.0d0)) .or. (.not. (z <= 55000000.0d0))) then
tmp = x + ((y * 0.0692910599291889d0) - ((y * (-0.07512208616047561d0)) / z))
else
tmp = ((y * ((z * (0.4917317610505968d0 + (z * 0.0692910599291889d0))) + 0.279195317918525d0)) / ((z * (z + 6.012459259764103d0)) + 3.350343815022304d0)) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -400000000.0) || !(z <= 55000000.0)) {
tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z));
} else {
tmp = ((y * ((z * (0.4917317610505968 + (z * 0.0692910599291889))) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -400000000.0) or not (z <= 55000000.0): tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z)) else: tmp = ((y * ((z * (0.4917317610505968 + (z * 0.0692910599291889))) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -400000000.0) || !(z <= 55000000.0)) tmp = Float64(x + Float64(Float64(y * 0.0692910599291889) - Float64(Float64(y * -0.07512208616047561) / z))); else tmp = Float64(Float64(Float64(y * Float64(Float64(z * Float64(0.4917317610505968 + Float64(z * 0.0692910599291889))) + 0.279195317918525)) / Float64(Float64(z * Float64(z + 6.012459259764103)) + 3.350343815022304)) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -400000000.0) || ~((z <= 55000000.0))) tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z)); else tmp = ((y * ((z * (0.4917317610505968 + (z * 0.0692910599291889))) + 0.279195317918525)) / ((z * (z + 6.012459259764103)) + 3.350343815022304)) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -400000000.0], N[Not[LessEqual[z, 55000000.0]], $MachinePrecision]], N[(x + N[(N[(y * 0.0692910599291889), $MachinePrecision] - N[(N[(y * -0.07512208616047561), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(N[(z * N[(0.4917317610505968 + N[(z * 0.0692910599291889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] / N[(N[(z * N[(z + 6.012459259764103), $MachinePrecision]), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -400000000 \lor \neg \left(z \leq 55000000\right):\\
\;\;\;\;x + \left(y \cdot 0.0692910599291889 - \frac{y \cdot -0.07512208616047561}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot \left(0.4917317610505968 + z \cdot 0.0692910599291889\right) + 0.279195317918525\right)}{z \cdot \left(z + 6.012459259764103\right) + 3.350343815022304} + x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -5.5) (not (<= z 5.0))) (+ x (* y 0.0692910599291889)) (+ x (+ (* -0.00277777777751721 (* y z)) (* y 0.08333333333333323)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5) || !(z <= 5.0)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-5.5d0)) .or. (.not. (z <= 5.0d0))) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = x + (((-0.00277777777751721d0) * (y * z)) + (y * 0.08333333333333323d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5) || !(z <= 5.0)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5) or not (z <= 5.0): tmp = x + (y * 0.0692910599291889) else: tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5) || !(z <= 5.0)) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(x + Float64(Float64(-0.00277777777751721 * Float64(y * z)) + Float64(y * 0.08333333333333323))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.5) || ~((z <= 5.0))) tmp = x + (y * 0.0692910599291889); else tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.5], N[Not[LessEqual[z, 5.0]], $MachinePrecision]], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.00277777777751721 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(y * 0.08333333333333323), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \lor \neg \left(z \leq 5\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + \left(-0.00277777777751721 \cdot \left(y \cdot z\right) + y \cdot 0.08333333333333323\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -5.5) (not (<= z 4.8))) (+ x (- (* y 0.0692910599291889) (/ (* y -0.07512208616047561) z))) (+ x (+ (* -0.00277777777751721 (* y z)) (* y 0.08333333333333323)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5) || !(z <= 4.8)) {
tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z));
} else {
tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-5.5d0)) .or. (.not. (z <= 4.8d0))) then
tmp = x + ((y * 0.0692910599291889d0) - ((y * (-0.07512208616047561d0)) / z))
else
tmp = x + (((-0.00277777777751721d0) * (y * z)) + (y * 0.08333333333333323d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5) || !(z <= 4.8)) {
tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z));
} else {
tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5) or not (z <= 4.8): tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z)) else: tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5) || !(z <= 4.8)) tmp = Float64(x + Float64(Float64(y * 0.0692910599291889) - Float64(Float64(y * -0.07512208616047561) / z))); else tmp = Float64(x + Float64(Float64(-0.00277777777751721 * Float64(y * z)) + Float64(y * 0.08333333333333323))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.5) || ~((z <= 4.8))) tmp = x + ((y * 0.0692910599291889) - ((y * -0.07512208616047561) / z)); else tmp = x + ((-0.00277777777751721 * (y * z)) + (y * 0.08333333333333323)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.5], N[Not[LessEqual[z, 4.8]], $MachinePrecision]], N[(x + N[(N[(y * 0.0692910599291889), $MachinePrecision] - N[(N[(y * -0.07512208616047561), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(-0.00277777777751721 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(y * 0.08333333333333323), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \lor \neg \left(z \leq 4.8\right):\\
\;\;\;\;x + \left(y \cdot 0.0692910599291889 - \frac{y \cdot -0.07512208616047561}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(-0.00277777777751721 \cdot \left(y \cdot z\right) + y \cdot 0.08333333333333323\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -5.5) (not (<= z 6.2))) (+ x (* y 0.0692910599291889)) (+ x (* y 0.08333333333333323))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5) || !(z <= 6.2)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * 0.08333333333333323);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-5.5d0)) .or. (.not. (z <= 6.2d0))) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = x + (y * 0.08333333333333323d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -5.5) || !(z <= 6.2)) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = x + (y * 0.08333333333333323);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -5.5) or not (z <= 6.2): tmp = x + (y * 0.0692910599291889) else: tmp = x + (y * 0.08333333333333323) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -5.5) || !(z <= 6.2)) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(x + Float64(y * 0.08333333333333323)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -5.5) || ~((z <= 6.2))) tmp = x + (y * 0.0692910599291889); else tmp = x + (y * 0.08333333333333323); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.5], N[Not[LessEqual[z, 6.2]], $MachinePrecision]], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * 0.08333333333333323), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \lor \neg \left(z \leq 6.2\right):\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot 0.08333333333333323\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= x -1.25e-50) x (if (<= x 4.2e-91) (* y 0.08333333333333323) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.25e-50) {
tmp = x;
} else if (x <= 4.2e-91) {
tmp = y * 0.08333333333333323;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.25d-50)) then
tmp = x
else if (x <= 4.2d-91) then
tmp = y * 0.08333333333333323d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.25e-50) {
tmp = x;
} else if (x <= 4.2e-91) {
tmp = y * 0.08333333333333323;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.25e-50: tmp = x elif x <= 4.2e-91: tmp = y * 0.08333333333333323 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.25e-50) tmp = x; elseif (x <= 4.2e-91) tmp = Float64(y * 0.08333333333333323); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.25e-50) tmp = x; elseif (x <= 4.2e-91) tmp = y * 0.08333333333333323; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.25e-50], x, If[LessEqual[x, 4.2e-91], N[(y * 0.08333333333333323), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-50}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-91}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y 3.7e+191) (+ x (* y 0.0692910599291889)) (* y 0.08333333333333323)))
double code(double x, double y, double z) {
double tmp;
if (y <= 3.7e+191) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = y * 0.08333333333333323;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= 3.7d+191) then
tmp = x + (y * 0.0692910599291889d0)
else
tmp = y * 0.08333333333333323d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= 3.7e+191) {
tmp = x + (y * 0.0692910599291889);
} else {
tmp = y * 0.08333333333333323;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= 3.7e+191: tmp = x + (y * 0.0692910599291889) else: tmp = y * 0.08333333333333323 return tmp
function code(x, y, z) tmp = 0.0 if (y <= 3.7e+191) tmp = Float64(x + Float64(y * 0.0692910599291889)); else tmp = Float64(y * 0.08333333333333323); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 3.7e+191) tmp = x + (y * 0.0692910599291889); else tmp = y * 0.08333333333333323; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, 3.7e+191], N[(x + N[(y * 0.0692910599291889), $MachinePrecision]), $MachinePrecision], N[(y * 0.08333333333333323), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.7 \cdot 10^{+191}:\\
\;\;\;\;x + y \cdot 0.0692910599291889\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.08333333333333323\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0
(-
(* (+ (/ 0.07512208616047561 z) 0.0692910599291889) y)
(- (/ (* 0.40462203869992125 y) (* z z)) x))))
(if (< z -8120153.652456675)
t_0
(if (< z 6.576118972787377e+20)
(+
x
(*
(*
y
(+
(* (+ (* z 0.0692910599291889) 0.4917317610505968) z)
0.279195317918525))
(/ 1.0 (+ (* (+ z 6.012459259764103) z) 3.350343815022304))))
t_0))))
double code(double x, double y, double z) {
double t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x);
double tmp;
if (z < -8120153.652456675) {
tmp = t_0;
} else if (z < 6.576118972787377e+20) {
tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (((0.07512208616047561d0 / z) + 0.0692910599291889d0) * y) - (((0.40462203869992125d0 * y) / (z * z)) - x)
if (z < (-8120153.652456675d0)) then
tmp = t_0
else if (z < 6.576118972787377d+20) then
tmp = x + ((y * ((((z * 0.0692910599291889d0) + 0.4917317610505968d0) * z) + 0.279195317918525d0)) * (1.0d0 / (((z + 6.012459259764103d0) * z) + 3.350343815022304d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x);
double tmp;
if (z < -8120153.652456675) {
tmp = t_0;
} else if (z < 6.576118972787377e+20) {
tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x) tmp = 0 if z < -8120153.652456675: tmp = t_0 elif z < 6.576118972787377e+20: tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(Float64(0.07512208616047561 / z) + 0.0692910599291889) * y) - Float64(Float64(Float64(0.40462203869992125 * y) / Float64(z * z)) - x)) tmp = 0.0 if (z < -8120153.652456675) tmp = t_0; elseif (z < 6.576118972787377e+20) tmp = Float64(x + Float64(Float64(y * Float64(Float64(Float64(Float64(z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * Float64(1.0 / Float64(Float64(Float64(z + 6.012459259764103) * z) + 3.350343815022304)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (((0.07512208616047561 / z) + 0.0692910599291889) * y) - (((0.40462203869992125 * y) / (z * z)) - x); tmp = 0.0; if (z < -8120153.652456675) tmp = t_0; elseif (z < 6.576118972787377e+20) tmp = x + ((y * ((((z * 0.0692910599291889) + 0.4917317610505968) * z) + 0.279195317918525)) * (1.0 / (((z + 6.012459259764103) * z) + 3.350343815022304))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(N[(0.07512208616047561 / z), $MachinePrecision] + 0.0692910599291889), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(0.40462203869992125 * y), $MachinePrecision] / N[(z * z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -8120153.652456675], t$95$0, If[Less[z, 6.576118972787377e+20], N[(x + N[(N[(y * N[(N[(N[(N[(z * 0.0692910599291889), $MachinePrecision] + 0.4917317610505968), $MachinePrecision] * z), $MachinePrecision] + 0.279195317918525), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(N[(z + 6.012459259764103), $MachinePrecision] * z), $MachinePrecision] + 3.350343815022304), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{0.07512208616047561}{z} + 0.0692910599291889\right) \cdot y - \left(\frac{0.40462203869992125 \cdot y}{z \cdot z} - x\right)\\
\mathbf{if}\;z < -8120153.652456675:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z < 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}{\left(z + 6.012459259764103\right) \cdot z + 3.350343815022304}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2024008
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, B"
:precision binary64
: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))))