
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x + y) - z) / (t * 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
def code(x, y, z, t): return ((x + y) - z) / (t * 2.0)
function code(x, y, z, t) return Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0)) end
function tmp = code(x, y, z, t) tmp = ((x + y) - z) / (t * 2.0); end
code[x_, y_, z_, t_] := N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x + y\right) - z}{t \cdot 2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x + y) - z) / (t * 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
def code(x, y, z, t): return ((x + y) - z) / (t * 2.0)
function code(x, y, z, t) return Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0)) end
function tmp = code(x, y, z, t) tmp = ((x + y) - z) / (t * 2.0); end
code[x_, y_, z_, t_] := N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x + y\right) - z}{t \cdot 2}
\end{array}
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x + y) - z) / (t * 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return ((x + y) - z) / (t * 2.0);
}
def code(x, y, z, t): return ((x + y) - z) / (t * 2.0)
function code(x, y, z, t) return Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0)) end
function tmp = code(x, y, z, t) tmp = ((x + y) - z) / (t * 2.0); end
code[x_, y_, z_, t_] := N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x + y\right) - z}{t \cdot 2}
\end{array}
Initial program 100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- (+ x y) z) (* t 2.0))))
(if (<= t_1 -5e+43)
(/ (- x z) 0.0)
(if (<= t_1 4e+304) (* (/ y t) 0.5) (/ (+ y x) 0.0)))))
double code(double x, double y, double z, double t) {
double t_1 = ((x + y) - z) / (t * 2.0);
double tmp;
if (t_1 <= -5e+43) {
tmp = (x - z) / 0.0;
} else if (t_1 <= 4e+304) {
tmp = (y / t) * 0.5;
} else {
tmp = (y + x) / 0.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((x + y) - z) / (t * 2.0d0)
if (t_1 <= (-5d+43)) then
tmp = (x - z) / 0.0d0
else if (t_1 <= 4d+304) then
tmp = (y / t) * 0.5d0
else
tmp = (y + x) / 0.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((x + y) - z) / (t * 2.0);
double tmp;
if (t_1 <= -5e+43) {
tmp = (x - z) / 0.0;
} else if (t_1 <= 4e+304) {
tmp = (y / t) * 0.5;
} else {
tmp = (y + x) / 0.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x + y) - z) / (t * 2.0) tmp = 0 if t_1 <= -5e+43: tmp = (x - z) / 0.0 elif t_1 <= 4e+304: tmp = (y / t) * 0.5 else: tmp = (y + x) / 0.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0)) tmp = 0.0 if (t_1 <= -5e+43) tmp = Float64(Float64(x - z) / 0.0); elseif (t_1 <= 4e+304) tmp = Float64(Float64(y / t) * 0.5); else tmp = Float64(Float64(y + x) / 0.0); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x + y) - z) / (t * 2.0); tmp = 0.0; if (t_1 <= -5e+43) tmp = (x - z) / 0.0; elseif (t_1 <= 4e+304) tmp = (y / t) * 0.5; else tmp = (y + x) / 0.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+43], N[(N[(x - z), $MachinePrecision] / 0.0), $MachinePrecision], If[LessEqual[t$95$1, 4e+304], N[(N[(y / t), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(y + x), $MachinePrecision] / 0.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x + y\right) - z}{t \cdot 2}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+43}:\\
\;\;\;\;\frac{x - z}{0}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+304}:\\
\;\;\;\;\frac{y}{t} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{y + x}{0}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64))) < -5.0000000000000004e43Initial program 100.0%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6487.7
Applied rewrites87.7%
Taylor expanded in y around 0
Applied rewrites68.8%
lift-+.f64N/A
flip-+N/A
Applied rewrites21.3%
if -5.0000000000000004e43 < (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64))) < 3.9999999999999998e304Initial program 100.0%
Taylor expanded in z around 0
div-add-revN/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6471.2
Applied rewrites71.2%
Taylor expanded in x around 0
Applied rewrites36.4%
if 3.9999999999999998e304 < (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64))) Initial program 100.0%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6493.5
Applied rewrites93.5%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6493.5
Applied rewrites93.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6475.5
Applied rewrites75.5%
lift-+.f64N/A
flip-+N/A
Applied rewrites51.6%
(FPCore (x y z t) :precision binary64 (if (<= (/ (- (+ x y) z) (* t 2.0)) 2e-85) (/ (- x z) 0.0) (/ (+ y x) 0.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((((x + y) - z) / (t * 2.0)) <= 2e-85) {
tmp = (x - z) / 0.0;
} else {
tmp = (y + x) / 0.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((((x + y) - z) / (t * 2.0d0)) <= 2d-85) then
tmp = (x - z) / 0.0d0
else
tmp = (y + x) / 0.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((((x + y) - z) / (t * 2.0)) <= 2e-85) {
tmp = (x - z) / 0.0;
} else {
tmp = (y + x) / 0.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (((x + y) - z) / (t * 2.0)) <= 2e-85: tmp = (x - z) / 0.0 else: tmp = (y + x) / 0.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0)) <= 2e-85) tmp = Float64(Float64(x - z) / 0.0); else tmp = Float64(Float64(y + x) / 0.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((((x + y) - z) / (t * 2.0)) <= 2e-85) tmp = (x - z) / 0.0; else tmp = (y + x) / 0.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], 2e-85], N[(N[(x - z), $MachinePrecision] / 0.0), $MachinePrecision], N[(N[(y + x), $MachinePrecision] / 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\left(x + y\right) - z}{t \cdot 2} \leq 2 \cdot 10^{-85}:\\
\;\;\;\;\frac{x - z}{0}\\
\mathbf{else}:\\
\;\;\;\;\frac{y + x}{0}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64))) < 2e-85Initial program 100.0%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6488.6
Applied rewrites88.6%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6488.6
Applied rewrites88.6%
Taylor expanded in y around 0
Applied rewrites69.1%
lift-+.f64N/A
flip-+N/A
Applied rewrites14.5%
if 2e-85 < (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64))) Initial program 100.0%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6490.5
Applied rewrites90.5%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6490.5
Applied rewrites90.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6470.9
Applied rewrites70.9%
lift-+.f64N/A
flip-+N/A
Applied rewrites16.3%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -1e+34) (* (/ x t) 0.5) (if (<= (+ x y) 5e+62) (/ (* -0.5 z) t) (* (/ y t) 0.5))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -1e+34) {
tmp = (x / t) * 0.5;
} else if ((x + y) <= 5e+62) {
tmp = (-0.5 * z) / t;
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x + y) <= (-1d+34)) then
tmp = (x / t) * 0.5d0
else if ((x + y) <= 5d+62) then
tmp = ((-0.5d0) * z) / t
else
tmp = (y / t) * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -1e+34) {
tmp = (x / t) * 0.5;
} else if ((x + y) <= 5e+62) {
tmp = (-0.5 * z) / t;
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -1e+34: tmp = (x / t) * 0.5 elif (x + y) <= 5e+62: tmp = (-0.5 * z) / t else: tmp = (y / t) * 0.5 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -1e+34) tmp = Float64(Float64(x / t) * 0.5); elseif (Float64(x + y) <= 5e+62) tmp = Float64(Float64(-0.5 * z) / t); else tmp = Float64(Float64(y / t) * 0.5); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= -1e+34) tmp = (x / t) * 0.5; elseif ((x + y) <= 5e+62) tmp = (-0.5 * z) / t; else tmp = (y / t) * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -1e+34], N[(N[(x / t), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 5e+62], N[(N[(-0.5 * z), $MachinePrecision] / t), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * 0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+34}:\\
\;\;\;\;\frac{x}{t} \cdot 0.5\\
\mathbf{elif}\;x + y \leq 5 \cdot 10^{+62}:\\
\;\;\;\;\frac{-0.5 \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot 0.5\\
\end{array}
\end{array}
if (+.f64 x y) < -9.99999999999999946e33Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6448.6
Applied rewrites48.6%
if -9.99999999999999946e33 < (+.f64 x y) < 5.00000000000000029e62Initial program 100.0%
Taylor expanded in z around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6469.0
Applied rewrites69.0%
Applied rewrites69.2%
if 5.00000000000000029e62 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around 0
div-add-revN/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6486.1
Applied rewrites86.1%
Taylor expanded in x around 0
Applied rewrites49.4%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -1e+34) (* (/ x t) 0.5) (if (<= (+ x y) 5e+62) (* (/ -0.5 t) z) (* (/ y t) 0.5))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -1e+34) {
tmp = (x / t) * 0.5;
} else if ((x + y) <= 5e+62) {
tmp = (-0.5 / t) * z;
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x + y) <= (-1d+34)) then
tmp = (x / t) * 0.5d0
else if ((x + y) <= 5d+62) then
tmp = ((-0.5d0) / t) * z
else
tmp = (y / t) * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -1e+34) {
tmp = (x / t) * 0.5;
} else if ((x + y) <= 5e+62) {
tmp = (-0.5 / t) * z;
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -1e+34: tmp = (x / t) * 0.5 elif (x + y) <= 5e+62: tmp = (-0.5 / t) * z else: tmp = (y / t) * 0.5 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -1e+34) tmp = Float64(Float64(x / t) * 0.5); elseif (Float64(x + y) <= 5e+62) tmp = Float64(Float64(-0.5 / t) * z); else tmp = Float64(Float64(y / t) * 0.5); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= -1e+34) tmp = (x / t) * 0.5; elseif ((x + y) <= 5e+62) tmp = (-0.5 / t) * z; else tmp = (y / t) * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -1e+34], N[(N[(x / t), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 5e+62], N[(N[(-0.5 / t), $MachinePrecision] * z), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * 0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+34}:\\
\;\;\;\;\frac{x}{t} \cdot 0.5\\
\mathbf{elif}\;x + y \leq 5 \cdot 10^{+62}:\\
\;\;\;\;\frac{-0.5}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot 0.5\\
\end{array}
\end{array}
if (+.f64 x y) < -9.99999999999999946e33Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6448.6
Applied rewrites48.6%
if -9.99999999999999946e33 < (+.f64 x y) < 5.00000000000000029e62Initial program 100.0%
Taylor expanded in z around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6469.0
Applied rewrites69.0%
if 5.00000000000000029e62 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around 0
div-add-revN/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6486.1
Applied rewrites86.1%
Taylor expanded in x around 0
Applied rewrites49.4%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -4e+109) (/ (- x z) 0.0) (if (<= (+ x y) 5e+62) (* (/ -0.5 t) z) (* (/ y t) 0.5))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -4e+109) {
tmp = (x - z) / 0.0;
} else if ((x + y) <= 5e+62) {
tmp = (-0.5 / t) * z;
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x + y) <= (-4d+109)) then
tmp = (x - z) / 0.0d0
else if ((x + y) <= 5d+62) then
tmp = ((-0.5d0) / t) * z
else
tmp = (y / t) * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -4e+109) {
tmp = (x - z) / 0.0;
} else if ((x + y) <= 5e+62) {
tmp = (-0.5 / t) * z;
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -4e+109: tmp = (x - z) / 0.0 elif (x + y) <= 5e+62: tmp = (-0.5 / t) * z else: tmp = (y / t) * 0.5 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -4e+109) tmp = Float64(Float64(x - z) / 0.0); elseif (Float64(x + y) <= 5e+62) tmp = Float64(Float64(-0.5 / t) * z); else tmp = Float64(Float64(y / t) * 0.5); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= -4e+109) tmp = (x - z) / 0.0; elseif ((x + y) <= 5e+62) tmp = (-0.5 / t) * z; else tmp = (y / t) * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -4e+109], N[(N[(x - z), $MachinePrecision] / 0.0), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 5e+62], N[(N[(-0.5 / t), $MachinePrecision] * z), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * 0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -4 \cdot 10^{+109}:\\
\;\;\;\;\frac{x - z}{0}\\
\mathbf{elif}\;x + y \leq 5 \cdot 10^{+62}:\\
\;\;\;\;\frac{-0.5}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot 0.5\\
\end{array}
\end{array}
if (+.f64 x y) < -3.99999999999999993e109Initial program 100.0%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6495.8
Applied rewrites95.8%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6495.8
Applied rewrites95.8%
Taylor expanded in y around 0
Applied rewrites61.6%
lift-+.f64N/A
flip-+N/A
Applied rewrites16.8%
if -3.99999999999999993e109 < (+.f64 x y) < 5.00000000000000029e62Initial program 100.0%
Taylor expanded in z around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6464.2
Applied rewrites64.2%
if 5.00000000000000029e62 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around 0
div-add-revN/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6486.1
Applied rewrites86.1%
Taylor expanded in x around 0
Applied rewrites49.4%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -4e-275) (/ (- x z) (+ t t)) (/ (- y z) (+ t t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -4e-275) {
tmp = (x - z) / (t + t);
} else {
tmp = (y - z) / (t + t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x + y) <= (-4d-275)) then
tmp = (x - z) / (t + t)
else
tmp = (y - z) / (t + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -4e-275) {
tmp = (x - z) / (t + t);
} else {
tmp = (y - z) / (t + t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -4e-275: tmp = (x - z) / (t + t) else: tmp = (y - z) / (t + t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -4e-275) tmp = Float64(Float64(x - z) / Float64(t + t)); else tmp = Float64(Float64(y - z) / Float64(t + t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= -4e-275) tmp = (x - z) / (t + t); else tmp = (y - z) / (t + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -4e-275], N[(N[(x - z), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -4 \cdot 10^{-275}:\\
\;\;\;\;\frac{x - z}{t + t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{t + t}\\
\end{array}
\end{array}
if (+.f64 x y) < -3.99999999999999974e-275Initial program 100.0%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6490.8
Applied rewrites90.8%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6490.8
Applied rewrites90.8%
Taylor expanded in y around 0
Applied rewrites69.7%
if -3.99999999999999974e-275 < (+.f64 x y) Initial program 100.0%
Taylor expanded in x around 0
lower--.f6471.1
Applied rewrites71.1%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6471.1
Applied rewrites71.1%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) 2e+94) (/ (- x z) (+ t t)) (/ (+ y x) (+ t t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= 2e+94) {
tmp = (x - z) / (t + t);
} else {
tmp = (y + x) / (t + t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x + y) <= 2d+94) then
tmp = (x - z) / (t + t)
else
tmp = (y + x) / (t + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= 2e+94) {
tmp = (x - z) / (t + t);
} else {
tmp = (y + x) / (t + t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= 2e+94: tmp = (x - z) / (t + t) else: tmp = (y + x) / (t + t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= 2e+94) tmp = Float64(Float64(x - z) / Float64(t + t)); else tmp = Float64(Float64(y + x) / Float64(t + t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= 2e+94) tmp = (x - z) / (t + t); else tmp = (y + x) / (t + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], 2e+94], N[(N[(x - z), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 2 \cdot 10^{+94}:\\
\;\;\;\;\frac{x - z}{t + t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y + x}{t + t}\\
\end{array}
\end{array}
if (+.f64 x y) < 2e94Initial program 100.0%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6487.6
Applied rewrites87.6%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in y around 0
Applied rewrites75.0%
if 2e94 < (+.f64 x y) Initial program 100.0%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6494.3
Applied rewrites94.3%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6494.3
Applied rewrites94.3%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f6490.9
Applied rewrites90.9%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) 2e+94) (/ (- x z) (+ t t)) (* (/ y t) 0.5)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= 2e+94) {
tmp = (x - z) / (t + t);
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x + y) <= 2d+94) then
tmp = (x - z) / (t + t)
else
tmp = (y / t) * 0.5d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= 2e+94) {
tmp = (x - z) / (t + t);
} else {
tmp = (y / t) * 0.5;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= 2e+94: tmp = (x - z) / (t + t) else: tmp = (y / t) * 0.5 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= 2e+94) tmp = Float64(Float64(x - z) / Float64(t + t)); else tmp = Float64(Float64(y / t) * 0.5); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= 2e+94) tmp = (x - z) / (t + t); else tmp = (y / t) * 0.5; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], 2e+94], N[(N[(x - z), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 2 \cdot 10^{+94}:\\
\;\;\;\;\frac{x - z}{t + t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot 0.5\\
\end{array}
\end{array}
if (+.f64 x y) < 2e94Initial program 100.0%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6487.6
Applied rewrites87.6%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6487.6
Applied rewrites87.6%
Taylor expanded in y around 0
Applied rewrites75.0%
if 2e94 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around 0
div-add-revN/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f6490.9
Applied rewrites90.9%
Taylor expanded in x around 0
Applied rewrites50.5%
(FPCore (x y z t) :precision binary64 (/ (- x z) 0.0))
double code(double x, double y, double z, double t) {
return (x - z) / 0.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - z) / 0.0d0
end function
public static double code(double x, double y, double z, double t) {
return (x - z) / 0.0;
}
def code(x, y, z, t): return (x - z) / 0.0
function code(x, y, z, t) return Float64(Float64(x - z) / 0.0) end
function tmp = code(x, y, z, t) tmp = (x - z) / 0.0; end
code[x_, y_, z_, t_] := N[(N[(x - z), $MachinePrecision] / 0.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - z}{0}
\end{array}
Initial program 100.0%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
distribute-rgt-inN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower--.f64N/A
lower-/.f6489.4
Applied rewrites89.4%
lift-*.f64N/A
*-commutativeN/A
count-2-revN/A
lower-+.f6489.4
Applied rewrites89.4%
Taylor expanded in y around 0
Applied rewrites69.5%
lift-+.f64N/A
flip-+N/A
Applied rewrites14.5%
herbie shell --seed 2024329
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, B"
:precision binary64
(/ (- (+ x y) z) (* t 2.0)))