
(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 10 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 99.2%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ (* a b) 4.0)) (t_2 (+ (* x y) (/ (* z t) 16.0))))
(if (<= (* z t) -2.25e-82)
(+ t_2 c)
(if (<= (* z t) 1.4e+75) (- (+ (* x y) c) t_1) (- t_2 t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = (a * b) / 4.0;
double t_2 = (x * y) + ((z * t) / 16.0);
double tmp;
if ((z * t) <= -2.25e-82) {
tmp = t_2 + c;
} else if ((z * t) <= 1.4e+75) {
tmp = ((x * y) + c) - t_1;
} else {
tmp = t_2 - 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) :: t_2
real(8) :: tmp
t_1 = (a * b) / 4.0d0
t_2 = (x * y) + ((z * t) / 16.0d0)
if ((z * t) <= (-2.25d-82)) then
tmp = t_2 + c
else if ((z * t) <= 1.4d+75) then
tmp = ((x * y) + c) - t_1
else
tmp = t_2 - 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 = (a * b) / 4.0;
double t_2 = (x * y) + ((z * t) / 16.0);
double tmp;
if ((z * t) <= -2.25e-82) {
tmp = t_2 + c;
} else if ((z * t) <= 1.4e+75) {
tmp = ((x * y) + c) - t_1;
} else {
tmp = t_2 - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = (a * b) / 4.0 t_2 = (x * y) + ((z * t) / 16.0) tmp = 0 if (z * t) <= -2.25e-82: tmp = t_2 + c elif (z * t) <= 1.4e+75: tmp = ((x * y) + c) - t_1 else: tmp = t_2 - t_1 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(Float64(a * b) / 4.0) t_2 = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) tmp = 0.0 if (Float64(z * t) <= -2.25e-82) tmp = Float64(t_2 + c); elseif (Float64(z * t) <= 1.4e+75) tmp = Float64(Float64(Float64(x * y) + c) - t_1); else tmp = Float64(t_2 - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = (a * b) / 4.0; t_2 = (x * y) + ((z * t) / 16.0); tmp = 0.0; if ((z * t) <= -2.25e-82) tmp = t_2 + c; elseif ((z * t) <= 1.4e+75) tmp = ((x * y) + c) - t_1; else tmp = t_2 - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -2.25e-82], N[(t$95$2 + c), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1.4e+75], N[(N[(N[(x * y), $MachinePrecision] + c), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$2 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a \cdot b}{4}\\
t_2 := x \cdot y + \frac{z \cdot t}{16}\\
\mathbf{if}\;z \cdot t \leq -2.25 \cdot 10^{-82}:\\
\;\;\;\;t\_2 + c\\
\mathbf{elif}\;z \cdot t \leq 1.4 \cdot 10^{+75}:\\
\;\;\;\;\left(x \cdot y + c\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2 - t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -2.2499999999999999e-82Initial program 98.7%
Taylor expanded in x around 0
Applied rewrites88.9%
if -2.2499999999999999e-82 < (*.f64 z t) < 1.40000000000000006e75Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites70.8%
Taylor expanded in x around 0
Applied rewrites96.3%
if 1.40000000000000006e75 < (*.f64 z t) Initial program 97.6%
Taylor expanded in x around 0
Applied rewrites92.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (* x y) (/ (* z t) 16.0))))
(if (<= (* z t) -2.25e-82)
t_1
(if (<= (* z t) 1.55e-8)
(- (* x y) (/ (* a b) 4.0))
(if (<= (* z t) 2e+75) (+ (* 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) <= -2.25e-82) {
tmp = t_1;
} else if ((z * t) <= 1.55e-8) {
tmp = (x * y) - ((a * b) / 4.0);
} else if ((z * t) <= 2e+75) {
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) <= (-2.25d-82)) then
tmp = t_1
else if ((z * t) <= 1.55d-8) then
tmp = (x * y) - ((a * b) / 4.0d0)
else if ((z * t) <= 2d+75) 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) <= -2.25e-82) {
tmp = t_1;
} else if ((z * t) <= 1.55e-8) {
tmp = (x * y) - ((a * b) / 4.0);
} else if ((z * t) <= 2e+75) {
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) <= -2.25e-82: tmp = t_1 elif (z * t) <= 1.55e-8: tmp = (x * y) - ((a * b) / 4.0) elif (z * t) <= 2e+75: 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) <= -2.25e-82) tmp = t_1; elseif (Float64(z * t) <= 1.55e-8) tmp = Float64(Float64(x * y) - Float64(Float64(a * b) / 4.0)); elseif (Float64(z * t) <= 2e+75) 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) <= -2.25e-82) tmp = t_1; elseif ((z * t) <= 1.55e-8) tmp = (x * y) - ((a * b) / 4.0); elseif ((z * t) <= 2e+75) 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], -2.25e-82], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1.55e-8], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+75], 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 -2.25 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 1.55 \cdot 10^{-8}:\\
\;\;\;\;x \cdot y - \frac{a \cdot b}{4}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+75}:\\
\;\;\;\;x \cdot y + c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -2.2499999999999999e-82 or 1.99999999999999985e75 < (*.f64 z t) Initial program 98.4%
Taylor expanded in x around 0
Applied rewrites87.8%
Taylor expanded in x around 0
Applied rewrites78.1%
if -2.2499999999999999e-82 < (*.f64 z t) < 1.55e-8Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites74.5%
Taylor expanded in x around 0
Applied rewrites73.4%
if 1.55e-8 < (*.f64 z t) < 1.99999999999999985e75Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites70.3%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (+ (* x y) (/ (* z t) 16.0)) c)))
(if (<= (* z t) -2.25e-82)
t_1
(if (<= (* z t) 2.55e+31) (- (+ (* 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)) + c;
double tmp;
if ((z * t) <= -2.25e-82) {
tmp = t_1;
} else if ((z * t) <= 2.55e+31) {
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)) + c
if ((z * t) <= (-2.25d-82)) then
tmp = t_1
else if ((z * t) <= 2.55d+31) 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)) + c;
double tmp;
if ((z * t) <= -2.25e-82) {
tmp = t_1;
} else if ((z * t) <= 2.55e+31) {
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)) + c tmp = 0 if (z * t) <= -2.25e-82: tmp = t_1 elif (z * t) <= 2.55e+31: 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(Float64(x * y) + Float64(Float64(z * t) / 16.0)) + c) tmp = 0.0 if (Float64(z * t) <= -2.25e-82) tmp = t_1; elseif (Float64(z * t) <= 2.55e+31) 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)) + c; tmp = 0.0; if ((z * t) <= -2.25e-82) tmp = t_1; elseif ((z * t) <= 2.55e+31) 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[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -2.25e-82], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 2.55e+31], 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 := \left(x \cdot y + \frac{z \cdot t}{16}\right) + c\\
\mathbf{if}\;z \cdot t \leq -2.25 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 2.55 \cdot 10^{+31}:\\
\;\;\;\;\left(x \cdot y + c\right) - \frac{a \cdot b}{4}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -2.2499999999999999e-82 or 2.5499999999999998e31 < (*.f64 z t) Initial program 98.4%
Taylor expanded in x around 0
Applied rewrites89.3%
if -2.2499999999999999e-82 < (*.f64 z t) < 2.5499999999999998e31Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites72.2%
Taylor expanded in x around 0
Applied rewrites97.4%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (+ (* x y) (/ (* z t) 16.0))))
(if (<= (* z t) -3.7e+211)
t_1
(if (<= (* z t) 3.8e+77) (- (+ (* 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) <= -3.7e+211) {
tmp = t_1;
} else if ((z * t) <= 3.8e+77) {
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) <= (-3.7d+211)) then
tmp = t_1
else if ((z * t) <= 3.8d+77) 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) <= -3.7e+211) {
tmp = t_1;
} else if ((z * t) <= 3.8e+77) {
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) <= -3.7e+211: tmp = t_1 elif (z * t) <= 3.8e+77: 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) <= -3.7e+211) tmp = t_1; elseif (Float64(z * t) <= 3.8e+77) 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) <= -3.7e+211) tmp = t_1; elseif ((z * t) <= 3.8e+77) 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], -3.7e+211], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 3.8e+77], 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 -3.7 \cdot 10^{+211}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 3.8 \cdot 10^{+77}:\\
\;\;\;\;\left(x \cdot y + c\right) - \frac{a \cdot b}{4}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -3.7000000000000001e211 or 3.8000000000000001e77 < (*.f64 z t) Initial program 97.1%
Taylor expanded in x around 0
Applied rewrites92.4%
Taylor expanded in x around 0
Applied rewrites88.0%
if -3.7000000000000001e211 < (*.f64 z t) < 3.8000000000000001e77Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites74.0%
Taylor expanded in x around 0
Applied rewrites90.8%
(FPCore (x y z t a b c) :precision binary64 (let* ((t_1 (+ (* x y) (/ (* z t) 16.0)))) (if (<= (* z t) -1.12e-111) t_1 (if (<= (* z t) 2e+75) (+ (* 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.12e-111) {
tmp = t_1;
} else if ((z * t) <= 2e+75) {
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.12d-111)) then
tmp = t_1
else if ((z * t) <= 2d+75) 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.12e-111) {
tmp = t_1;
} else if ((z * t) <= 2e+75) {
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.12e-111: tmp = t_1 elif (z * t) <= 2e+75: 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.12e-111) tmp = t_1; elseif (Float64(z * t) <= 2e+75) 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.12e-111) tmp = t_1; elseif ((z * t) <= 2e+75) 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.12e-111], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 2e+75], 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.12 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+75}:\\
\;\;\;\;x \cdot y + c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -1.12000000000000009e-111 or 1.99999999999999985e75 < (*.f64 z t) Initial program 98.4%
Taylor expanded in x around 0
Applied rewrites88.3%
Taylor expanded in x around 0
Applied rewrites76.7%
if -1.12000000000000009e-111 < (*.f64 z t) < 1.99999999999999985e75Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites61.2%
(FPCore (x y z t a b c) :precision binary64 (if (<= (* x y) -1.06e-32) (* x y) (if (<= (* x y) 0.0092) (+ (* 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) <= -1.06e-32) {
tmp = x * y;
} else if ((x * y) <= 0.0092) {
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) <= (-1.06d-32)) then
tmp = x * y
else if ((x * y) <= 0.0092d0) 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) <= -1.06e-32) {
tmp = x * y;
} else if ((x * y) <= 0.0092) {
tmp = (a * b) + c;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (x * y) <= -1.06e-32: tmp = x * y elif (x * y) <= 0.0092: 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) <= -1.06e-32) tmp = Float64(x * y); elseif (Float64(x * y) <= 0.0092) 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) <= -1.06e-32) tmp = x * y; elseif ((x * y) <= 0.0092) 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], -1.06e-32], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.0092], N[(N[(a * b), $MachinePrecision] + c), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.06 \cdot 10^{-32}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 0.0092:\\
\;\;\;\;a \cdot b + c\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.05999999999999994e-32 or 0.0091999999999999998 < (*.f64 x y) Initial program 98.4%
Taylor expanded in x around 0
Applied rewrites88.6%
Taylor expanded in x around 0
Applied rewrites59.4%
if -1.05999999999999994e-32 < (*.f64 x y) < 0.0091999999999999998Initial program 100.0%
Taylor expanded in x around 0
Applied rewrites67.2%
Taylor expanded in x around 0
Applied rewrites9.3%
Taylor expanded in x around -inf
Applied rewrites30.1%
(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 99.2%
Taylor expanded in x around 0
Applied rewrites49.9%
(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 99.2%
Taylor expanded in x around 0
Applied rewrites79.0%
Taylor expanded in x around 0
Applied rewrites31.1%
(FPCore (x y z t a b c) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c) {
return a * b;
}
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 = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return a * b;
}
def code(x, y, z, t, a, b, c): return a * b
function code(x, y, z, t, a, b, c) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 99.2%
Taylor expanded in x around 0
Applied rewrites79.0%
Taylor expanded in x around 0
Applied rewrites73.3%
Taylor expanded in x around inf
Applied rewrites2.1%
Taylor expanded in y around inf
Applied rewrites2.2%
herbie shell --seed 2024321
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C"
:precision binary64
:pre (TRUE)
(+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))