
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
(FPCore (x y z t a b c) :precision binary64 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c): return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}
Initial program 98.8%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (+ (* x y) (/ (* z t) 16.0))) (t_2 (- t_1 (/ (* a b) 4.0)))) (if (<= (* a b) -6e+59) t_2 (if (<= (* a b) 3.6e+39) (+ t_1 c) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + ((z * t) / 16.0);
double t_2 = t_1 - ((a * b) / 4.0);
double tmp;
if ((a * b) <= -6e+59) {
tmp = t_2;
} else if ((a * b) <= 3.6e+39) {
tmp = t_1 + c;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) + ((z * t) / 16.0d0)
t_2 = t_1 - ((a * b) / 4.0d0)
if ((a * b) <= (-6d+59)) then
tmp = t_2
else if ((a * b) <= 3.6d+39) then
tmp = t_1 + c
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + ((z * t) / 16.0);
double t_2 = t_1 - ((a * b) / 4.0);
double tmp;
if ((a * b) <= -6e+59) {
tmp = t_2;
} else if ((a * b) <= 3.6e+39) {
tmp = t_1 + c;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) + ((z * t) / 16.0) t_2 = t_1 - ((a * b) / 4.0) tmp = 0 if (a * b) <= -6e+59: tmp = t_2 elif (a * b) <= 3.6e+39: tmp = t_1 + c else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) t_2 = Float64(t_1 - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (Float64(a * b) <= -6e+59) tmp = t_2; elseif (Float64(a * b) <= 3.6e+39) tmp = Float64(t_1 + c); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) + ((z * t) / 16.0); t_2 = t_1 - ((a * b) / 4.0); tmp = 0.0; if ((a * b) <= -6e+59) tmp = t_2; elseif ((a * b) <= 3.6e+39) tmp = t_1 + c; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -6e+59], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 3.6e+39], N[(t$95$1 + c), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + \frac{z \cdot t}{16}\\
t_2 := t\_1 - \frac{a \cdot b}{4}\\
\mathbf{if}\;a \cdot b \leq -6 \cdot 10^{+59}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 3.6 \cdot 10^{+39}:\\
\;\;\;\;t\_1 + c\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -6.0000000000000001e59 or 3.59999999999999984e39 < (*.f64 a b) Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites94.0%
if -6.0000000000000001e59 < (*.f64 a b) < 3.59999999999999984e39Initial program 98.5%
Taylor expanded in x around 0
Applied rewrites97.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (* x y) (/ (* a b) 4.0))))
(if (<= (* a b) -9.5e+124)
t_1
(if (<= (* a b) 3.9e-51)
(+ (* x y) (/ (* z t) 16.0))
(if (<= (* a b) 3.6e+39) (+ (* x y) c) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) / 4.0);
double tmp;
if ((a * b) <= -9.5e+124) {
tmp = t_1;
} else if ((a * b) <= 3.9e-51) {
tmp = (x * y) + ((z * t) / 16.0);
} else if ((a * b) <= 3.6e+39) {
tmp = (x * y) + c;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) - ((a * b) / 4.0d0)
if ((a * b) <= (-9.5d+124)) then
tmp = t_1
else if ((a * b) <= 3.9d-51) then
tmp = (x * y) + ((z * t) / 16.0d0)
else if ((a * b) <= 3.6d+39) then
tmp = (x * y) + c
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) - ((a * b) / 4.0);
double tmp;
if ((a * b) <= -9.5e+124) {
tmp = t_1;
} else if ((a * b) <= 3.9e-51) {
tmp = (x * y) + ((z * t) / 16.0);
} else if ((a * b) <= 3.6e+39) {
tmp = (x * y) + c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) - ((a * b) / 4.0) tmp = 0 if (a * b) <= -9.5e+124: tmp = t_1 elif (a * b) <= 3.9e-51: tmp = (x * y) + ((z * t) / 16.0) elif (a * b) <= 3.6e+39: tmp = (x * y) + c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (Float64(a * b) <= -9.5e+124) tmp = t_1; elseif (Float64(a * b) <= 3.9e-51) tmp = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)); elseif (Float64(a * b) <= 3.6e+39) tmp = Float64(Float64(x * y) + c); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) - ((a * b) / 4.0); tmp = 0.0; if ((a * b) <= -9.5e+124) tmp = t_1; elseif ((a * b) <= 3.9e-51) tmp = (x * y) + ((z * t) / 16.0); elseif ((a * b) <= 3.6e+39) tmp = (x * y) + c; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -9.5e+124], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 3.9e-51], N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.6e+39], N[(N[(x * y), $MachinePrecision] + c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y - \frac{a \cdot b}{4}\\
\mathbf{if}\;a \cdot b \leq -9.5 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 3.9 \cdot 10^{-51}:\\
\;\;\;\;x \cdot y + \frac{z \cdot t}{16}\\
\mathbf{elif}\;a \cdot b \leq 3.6 \cdot 10^{+39}:\\
\;\;\;\;x \cdot y + c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -9.50000000000000004e124 or 3.59999999999999984e39 < (*.f64 a b) Initial program 99.0%
Taylor expanded in x around 0
Applied rewrites93.3%
Taylor expanded in x around 0
Applied rewrites83.7%
if -9.50000000000000004e124 < (*.f64 a b) < 3.8999999999999997e-51Initial program 98.5%
Taylor expanded in x around 0
Applied rewrites74.8%
Taylor expanded in x around 0
Applied rewrites70.6%
if 3.8999999999999997e-51 < (*.f64 a b) < 3.59999999999999984e39Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites92.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (- (+ (* x y) c) (/ (* a b) 4.0))))
(if (<= (* a b) -9.8e+124)
t_1
(if (<= (* a b) 80.0) (+ (+ (* x y) (/ (* z t) 16.0)) c) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + c) - ((a * b) / 4.0);
double tmp;
if ((a * b) <= -9.8e+124) {
tmp = t_1;
} else if ((a * b) <= 80.0) {
tmp = ((x * y) + ((z * t) / 16.0)) + c;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = ((x * y) + c) - ((a * b) / 4.0d0)
if ((a * b) <= (-9.8d+124)) then
tmp = t_1
else if ((a * b) <= 80.0d0) then
tmp = ((x * y) + ((z * t) / 16.0d0)) + c
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = ((x * y) + c) - ((a * b) / 4.0);
double tmp;
if ((a * b) <= -9.8e+124) {
tmp = t_1;
} else if ((a * b) <= 80.0) {
tmp = ((x * y) + ((z * t) / 16.0)) + c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = ((x * y) + c) - ((a * b) / 4.0) tmp = 0 if (a * b) <= -9.8e+124: tmp = t_1 elif (a * b) <= 80.0: tmp = ((x * y) + ((z * t) / 16.0)) + c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(Float64(x * y) + c) - Float64(Float64(a * b) / 4.0)) tmp = 0.0 if (Float64(a * b) <= -9.8e+124) tmp = t_1; elseif (Float64(a * b) <= 80.0) tmp = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) + c); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = ((x * y) + c) - ((a * b) / 4.0); tmp = 0.0; if ((a * b) <= -9.8e+124) tmp = t_1; elseif ((a * b) <= 80.0) tmp = ((x * y) + ((z * t) / 16.0)) + c; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + c), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -9.8e+124], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 80.0], N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot y + c\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;a \cdot b \leq -9.8 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 80:\\
\;\;\;\;\left(x \cdot y + \frac{z \cdot t}{16}\right) + c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -9.80000000000000069e124 or 80 < (*.f64 a b) Initial program 99.1%
Taylor expanded in x around 0
Applied rewrites91.0%
Taylor expanded in x around 0
Applied rewrites89.3%
if -9.80000000000000069e124 < (*.f64 a b) < 80Initial program 98.6%
Taylor expanded in x around 0
Applied rewrites94.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (* x y) (/ (* z t) 16.0))))
(if (<= (* z t) -1.65e+143)
t_1
(if (<= (* z t) 4.5e+89) (- (+ (* x y) c) (/ (* a b) 4.0)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + ((z * t) / 16.0);
double tmp;
if ((z * t) <= -1.65e+143) {
tmp = t_1;
} else if ((z * t) <= 4.5e+89) {
tmp = ((x * y) + c) - ((a * b) / 4.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + ((z * t) / 16.0d0)
if ((z * t) <= (-1.65d+143)) then
tmp = t_1
else if ((z * t) <= 4.5d+89) then
tmp = ((x * y) + c) - ((a * b) / 4.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + ((z * t) / 16.0);
double tmp;
if ((z * t) <= -1.65e+143) {
tmp = t_1;
} else if ((z * t) <= 4.5e+89) {
tmp = ((x * y) + c) - ((a * b) / 4.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) + ((z * t) / 16.0) tmp = 0 if (z * t) <= -1.65e+143: tmp = t_1 elif (z * t) <= 4.5e+89: tmp = ((x * y) + c) - ((a * b) / 4.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) tmp = 0.0 if (Float64(z * t) <= -1.65e+143) tmp = t_1; elseif (Float64(z * t) <= 4.5e+89) tmp = Float64(Float64(Float64(x * y) + c) - Float64(Float64(a * b) / 4.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) + ((z * t) / 16.0); tmp = 0.0; if ((z * t) <= -1.65e+143) tmp = t_1; elseif ((z * t) <= 4.5e+89) tmp = ((x * y) + c) - ((a * b) / 4.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1.65e+143], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 4.5e+89], N[(N[(N[(x * y), $MachinePrecision] + c), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + \frac{z \cdot t}{16}\\
\mathbf{if}\;z \cdot t \leq -1.65 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 4.5 \cdot 10^{+89}:\\
\;\;\;\;\left(x \cdot y + c\right) - \frac{a \cdot b}{4}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -1.65e143 or 4.5e89 < (*.f64 z t) Initial program 96.4%
Taylor expanded in x around 0
Applied rewrites88.0%
Taylor expanded in x around 0
Applied rewrites78.3%
if -1.65e143 < (*.f64 z t) < 4.5e89Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites76.9%
Taylor expanded in x around 0
Applied rewrites92.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (* x y) (/ (* z t) 16.0))))
(if (<= (* z t) -1.25e+76)
t_1
(if (<= (* z t) 5.1e+15) (+ (* x y) c) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + ((z * t) / 16.0);
double tmp;
if ((z * t) <= -1.25e+76) {
tmp = t_1;
} else if ((z * t) <= 5.1e+15) {
tmp = (x * y) + c;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + ((z * t) / 16.0d0)
if ((z * t) <= (-1.25d+76)) then
tmp = t_1
else if ((z * t) <= 5.1d+15) then
tmp = (x * y) + c
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (x * y) + ((z * t) / 16.0);
double tmp;
if ((z * t) <= -1.25e+76) {
tmp = t_1;
} else if ((z * t) <= 5.1e+15) {
tmp = (x * y) + c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (x * y) + ((z * t) / 16.0) tmp = 0 if (z * t) <= -1.25e+76: tmp = t_1 elif (z * t) <= 5.1e+15: tmp = (x * y) + c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) tmp = 0.0 if (Float64(z * t) <= -1.25e+76) tmp = t_1; elseif (Float64(z * t) <= 5.1e+15) tmp = Float64(Float64(x * y) + c); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (x * y) + ((z * t) / 16.0); tmp = 0.0; if ((z * t) <= -1.25e+76) tmp = t_1; elseif ((z * t) <= 5.1e+15) tmp = (x * y) + c; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1.25e+76], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 5.1e+15], N[(N[(x * y), $MachinePrecision] + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + \frac{z \cdot t}{16}\\
\mathbf{if}\;z \cdot t \leq -1.25 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 5.1 \cdot 10^{+15}:\\
\;\;\;\;x \cdot y + c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -1.24999999999999998e76 or 5.1e15 < (*.f64 z t) Initial program 97.3%
Taylor expanded in x around 0
Applied rewrites87.8%
Taylor expanded in x around 0
Applied rewrites72.0%
if -1.24999999999999998e76 < (*.f64 z t) < 5.1e15Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites62.1%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* x y) -4800000000000.0) (* x y) (if (<= (* x y) 2.8e+81) (+ (* a b) c) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -4800000000000.0) {
tmp = x * y;
} else if ((x * y) <= 2.8e+81) {
tmp = (a * b) + c;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((x * y) <= (-4800000000000.0d0)) then
tmp = x * y
else if ((x * y) <= 2.8d+81) then
tmp = (a * b) + c
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((x * y) <= -4800000000000.0) {
tmp = x * y;
} else if ((x * y) <= 2.8e+81) {
tmp = (a * b) + c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -4800000000000.0: tmp = x * y elif (x * y) <= 2.8e+81: tmp = (a * b) + c else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(x * y) <= -4800000000000.0) tmp = Float64(x * y); elseif (Float64(x * y) <= 2.8e+81) tmp = Float64(Float64(a * b) + c); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((x * y) <= -4800000000000.0) tmp = x * y; elseif ((x * y) <= 2.8e+81) tmp = (a * b) + c; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -4800000000000.0], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.8e+81], N[(N[(a * b), $MachinePrecision] + c), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4800000000000:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{+81}:\\
\;\;\;\;a \cdot b + c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.8e12 or 2.79999999999999995e81 < (*.f64 x y) Initial program 98.2%
Taylor expanded in x around 0
Applied rewrites91.4%
Taylor expanded in x around 0
Applied rewrites64.2%
if -4.8e12 < (*.f64 x y) < 2.79999999999999995e81Initial program 99.3%
Taylor expanded in x around 0
Applied rewrites68.8%
Taylor expanded in x around 0
Applied rewrites10.2%
Taylor expanded in x around -inf
Applied rewrites27.5%
(FPCore (x y z t a b c) :precision binary64 (+ (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
return (x * y) + c;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (x * y) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (x * y) + c;
}
def code(x, y, z, t, a, b, c): return (x * y) + c
function code(x, y, z, t, a, b, c) return Float64(Float64(x * y) + c) end
function tmp = code(x, y, z, t, a, b, c) tmp = (x * y) + c; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
\\
x \cdot y + c
\end{array}
Initial program 98.8%
Taylor expanded in x around 0
Applied rewrites48.6%
(FPCore (x y z t a b c) :precision binary64 (* x y))
double code(double x, double y, double z, double t, double a, double b, double c) {
return x * y;
}
real(8) function code(x, y, z, t, a, b, c)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = x * y
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return x * y;
}
def code(x, y, z, t, a, b, c): return x * y
function code(x, y, z, t, a, b, c) return Float64(x * y) end
function tmp = code(x, y, z, t, a, b, c) tmp = x * y; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
\\
x \cdot y
\end{array}
Initial program 98.8%
Taylor expanded in x around 0
Applied rewrites80.6%
Taylor expanded in x around 0
Applied rewrites31.1%
herbie shell --seed 2024313
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))