
(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 11 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 (if (<= y -7.2e-296) (/ (/ x t) 2.0) (if (<= y 8.4e+70) (/ (* z -0.5) t) (/ (/ y t) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e-296) {
tmp = (x / t) / 2.0;
} else if (y <= 8.4e+70) {
tmp = (z * -0.5) / t;
} else {
tmp = (y / t) / 2.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 (y <= (-7.2d-296)) then
tmp = (x / t) / 2.0d0
else if (y <= 8.4d+70) then
tmp = (z * (-0.5d0)) / t
else
tmp = (y / t) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.2e-296) {
tmp = (x / t) / 2.0;
} else if (y <= 8.4e+70) {
tmp = (z * -0.5) / t;
} else {
tmp = (y / t) / 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.2e-296: tmp = (x / t) / 2.0 elif y <= 8.4e+70: tmp = (z * -0.5) / t else: tmp = (y / t) / 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.2e-296) tmp = Float64(Float64(x / t) / 2.0); elseif (y <= 8.4e+70) tmp = Float64(Float64(z * -0.5) / t); else tmp = Float64(Float64(y / t) / 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.2e-296) tmp = (x / t) / 2.0; elseif (y <= 8.4e+70) tmp = (z * -0.5) / t; else tmp = (y / t) / 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e-296], N[(N[(x / t), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[y, 8.4e+70], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(N[(y / t), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-296}:\\
\;\;\;\;\frac{\frac{x}{t}}{2}\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{+70}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{t}}{2}\\
\end{array}
\end{array}
if y < -7.19999999999999961e-296Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
/-lowering-/.f6435.8%
Simplified35.8%
if -7.19999999999999961e-296 < y < 8.4000000000000003e70Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in z around inf
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f6451.4%
Simplified51.4%
if 8.4000000000000003e70 < y Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
/-lowering-/.f6477.3%
Simplified77.3%
(FPCore (x y z t) :precision binary64 (if (<= y -6e-296) (/ (/ x t) 2.0) (if (<= y 6.9e+69) (/ (* z -0.5) t) (* y (/ 0.5 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e-296) {
tmp = (x / t) / 2.0;
} else if (y <= 6.9e+69) {
tmp = (z * -0.5) / t;
} else {
tmp = y * (0.5 / 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 (y <= (-6d-296)) then
tmp = (x / t) / 2.0d0
else if (y <= 6.9d+69) then
tmp = (z * (-0.5d0)) / t
else
tmp = y * (0.5d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6e-296) {
tmp = (x / t) / 2.0;
} else if (y <= 6.9e+69) {
tmp = (z * -0.5) / t;
} else {
tmp = y * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6e-296: tmp = (x / t) / 2.0 elif y <= 6.9e+69: tmp = (z * -0.5) / t else: tmp = y * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6e-296) tmp = Float64(Float64(x / t) / 2.0); elseif (y <= 6.9e+69) tmp = Float64(Float64(z * -0.5) / t); else tmp = Float64(y * Float64(0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6e-296) tmp = (x / t) / 2.0; elseif (y <= 6.9e+69) tmp = (z * -0.5) / t; else tmp = y * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6e-296], N[(N[(x / t), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[y, 6.9e+69], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(y * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-296}:\\
\;\;\;\;\frac{\frac{x}{t}}{2}\\
\mathbf{elif}\;y \leq 6.9 \cdot 10^{+69}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if y < -5.9999999999999995e-296Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
/-lowering-/.f6435.8%
Simplified35.8%
if -5.9999999999999995e-296 < y < 6.9000000000000001e69Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in z around inf
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f6451.4%
Simplified51.4%
if 6.9000000000000001e69 < y Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
associate-/l/N/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
sub-negN/A
+-lowering-+.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified77.1%
Final simplification48.1%
(FPCore (x y z t) :precision binary64 (if (<= y -3.8e-297) (* x (/ 0.5 t)) (if (<= y 1.06e+74) (/ (* z -0.5) t) (* y (/ 0.5 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e-297) {
tmp = x * (0.5 / t);
} else if (y <= 1.06e+74) {
tmp = (z * -0.5) / t;
} else {
tmp = y * (0.5 / 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 (y <= (-3.8d-297)) then
tmp = x * (0.5d0 / t)
else if (y <= 1.06d+74) then
tmp = (z * (-0.5d0)) / t
else
tmp = y * (0.5d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e-297) {
tmp = x * (0.5 / t);
} else if (y <= 1.06e+74) {
tmp = (z * -0.5) / t;
} else {
tmp = y * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.8e-297: tmp = x * (0.5 / t) elif y <= 1.06e+74: tmp = (z * -0.5) / t else: tmp = y * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.8e-297) tmp = Float64(x * Float64(0.5 / t)); elseif (y <= 1.06e+74) tmp = Float64(Float64(z * -0.5) / t); else tmp = Float64(y * Float64(0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.8e-297) tmp = x * (0.5 / t); elseif (y <= 1.06e+74) tmp = (z * -0.5) / t; else tmp = y * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.8e-297], N[(x * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e+74], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(y * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{-297}:\\
\;\;\;\;x \cdot \frac{0.5}{t}\\
\mathbf{elif}\;y \leq 1.06 \cdot 10^{+74}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if y < -3.80000000000000005e-297Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6435.7%
Simplified35.7%
if -3.80000000000000005e-297 < y < 1.05999999999999999e74Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in z around inf
associate-*r/N/A
metadata-evalN/A
associate-*r*N/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f6451.4%
Simplified51.4%
if 1.05999999999999999e74 < y Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
associate-/l/N/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
sub-negN/A
+-lowering-+.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified77.1%
Final simplification48.1%
(FPCore (x y z t) :precision binary64 (if (<= y 7.2e-58) (/ (/ (- x z) t) 2.0) (/ (/ (- y z) t) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.2e-58) {
tmp = ((x - z) / t) / 2.0;
} else {
tmp = ((y - z) / t) / 2.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 (y <= 7.2d-58) then
tmp = ((x - z) / t) / 2.0d0
else
tmp = ((y - z) / t) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.2e-58) {
tmp = ((x - z) / t) / 2.0;
} else {
tmp = ((y - z) / t) / 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 7.2e-58: tmp = ((x - z) / t) / 2.0 else: tmp = ((y - z) / t) / 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 7.2e-58) tmp = Float64(Float64(Float64(x - z) / t) / 2.0); else tmp = Float64(Float64(Float64(y - z) / t) / 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 7.2e-58) tmp = ((x - z) / t) / 2.0; else tmp = ((y - z) / t) / 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 7.2e-58], N[(N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.2 \cdot 10^{-58}:\\
\;\;\;\;\frac{\frac{x - z}{t}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y - z}{t}}{2}\\
\end{array}
\end{array}
if y < 7.20000000000000019e-58Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
/-lowering-/.f64N/A
--lowering--.f6476.3%
Simplified76.3%
if 7.20000000000000019e-58 < y Initial program 99.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
--lowering--.f6482.3%
Simplified82.3%
(FPCore (x y z t) :precision binary64 (if (<= y 4.8e-51) (/ (/ (- x z) t) 2.0) (* (/ 0.5 t) (- y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.8e-51) {
tmp = ((x - z) / t) / 2.0;
} else {
tmp = (0.5 / t) * (y - z);
}
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 (y <= 4.8d-51) then
tmp = ((x - z) / t) / 2.0d0
else
tmp = (0.5d0 / t) * (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.8e-51) {
tmp = ((x - z) / t) / 2.0;
} else {
tmp = (0.5 / t) * (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4.8e-51: tmp = ((x - z) / t) / 2.0 else: tmp = (0.5 / t) * (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4.8e-51) tmp = Float64(Float64(Float64(x - z) / t) / 2.0); else tmp = Float64(Float64(0.5 / t) * Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 4.8e-51) tmp = ((x - z) / t) / 2.0; else tmp = (0.5 / t) * (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4.8e-51], N[(N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(0.5 / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{-51}:\\
\;\;\;\;\frac{\frac{x - z}{t}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(y - z\right)\\
\end{array}
\end{array}
if y < 4.8e-51Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around 0
/-lowering-/.f64N/A
--lowering--.f6476.8%
Simplified76.8%
if 4.8e-51 < y Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
--lowering--.f6485.5%
Simplified85.5%
div-invN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6485.3%
Applied egg-rr85.3%
(FPCore (x y z t) :precision binary64 (if (<= y 4.6e-51) (* (/ 0.5 t) (- x z)) (* (/ 0.5 t) (- y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.6e-51) {
tmp = (0.5 / t) * (x - z);
} else {
tmp = (0.5 / t) * (y - z);
}
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 (y <= 4.6d-51) then
tmp = (0.5d0 / t) * (x - z)
else
tmp = (0.5d0 / t) * (y - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.6e-51) {
tmp = (0.5 / t) * (x - z);
} else {
tmp = (0.5 / t) * (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 4.6e-51: tmp = (0.5 / t) * (x - z) else: tmp = (0.5 / t) * (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 4.6e-51) tmp = Float64(Float64(0.5 / t) * Float64(x - z)); else tmp = Float64(Float64(0.5 / t) * Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 4.6e-51) tmp = (0.5 / t) * (x - z); else tmp = (0.5 / t) * (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 4.6e-51], N[(N[(0.5 / t), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.6 \cdot 10^{-51}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(y - z\right)\\
\end{array}
\end{array}
if y < 4.60000000000000004e-51Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
associate-/l/N/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
sub-negN/A
+-lowering-+.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around 0
--lowering--.f6476.6%
Simplified76.6%
if 4.60000000000000004e-51 < y Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
--lowering--.f6485.5%
Simplified85.5%
div-invN/A
metadata-evalN/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6485.3%
Applied egg-rr85.3%
(FPCore (x y z t) :precision binary64 (if (<= y 1.9e+120) (* (/ 0.5 t) (- x z)) (/ (/ y t) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.9e+120) {
tmp = (0.5 / t) * (x - z);
} else {
tmp = (y / t) / 2.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 (y <= 1.9d+120) then
tmp = (0.5d0 / t) * (x - z)
else
tmp = (y / t) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.9e+120) {
tmp = (0.5 / t) * (x - z);
} else {
tmp = (y / t) / 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.9e+120: tmp = (0.5 / t) * (x - z) else: tmp = (y / t) / 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.9e+120) tmp = Float64(Float64(0.5 / t) * Float64(x - z)); else tmp = Float64(Float64(y / t) / 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.9e+120) tmp = (0.5 / t) * (x - z); else tmp = (y / t) / 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.9e+120], N[(N[(0.5 / t), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision], N[(N[(y / t), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.9 \cdot 10^{+120}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{t}}{2}\\
\end{array}
\end{array}
if y < 1.8999999999999999e120Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
associate-/l/N/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
sub-negN/A
+-lowering-+.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around 0
--lowering--.f6476.4%
Simplified76.4%
if 1.8999999999999999e120 < y Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
/-lowering-/.f6483.0%
Simplified83.0%
(FPCore (x y z t) :precision binary64 (if (<= y 7.2e-58) (* x (/ 0.5 t)) (* y (/ 0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.2e-58) {
tmp = x * (0.5 / t);
} else {
tmp = y * (0.5 / 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 (y <= 7.2d-58) then
tmp = x * (0.5d0 / t)
else
tmp = y * (0.5d0 / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.2e-58) {
tmp = x * (0.5 / t);
} else {
tmp = y * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 7.2e-58: tmp = x * (0.5 / t) else: tmp = y * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 7.2e-58) tmp = Float64(x * Float64(0.5 / t)); else tmp = Float64(y * Float64(0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 7.2e-58) tmp = x * (0.5 / t); else tmp = y * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 7.2e-58], N[(x * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], N[(y * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.2 \cdot 10^{-58}:\\
\;\;\;\;x \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if y < 7.20000000000000019e-58Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6441.1%
Simplified41.1%
if 7.20000000000000019e-58 < y Initial program 99.9%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Simplified99.9%
associate-/l/N/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
sub-negN/A
+-lowering-+.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in y around inf
Simplified60.1%
Final simplification46.4%
(FPCore (x y z t) :precision binary64 (* (/ 0.5 t) (+ x (- y z))))
double code(double x, double y, double z, double t) {
return (0.5 / t) * (x + (y - z));
}
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 = (0.5d0 / t) * (x + (y - z))
end function
public static double code(double x, double y, double z, double t) {
return (0.5 / t) * (x + (y - z));
}
def code(x, y, z, t): return (0.5 / t) * (x + (y - z))
function code(x, y, z, t) return Float64(Float64(0.5 / t) * Float64(x + Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = (0.5 / t) * (x + (y - z)); end
code[x_, y_, z_, t_] := N[(N[(0.5 / t), $MachinePrecision] * N[(x + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5}{t} \cdot \left(x + \left(y - z\right)\right)
\end{array}
Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
associate-/l/N/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
sub-negN/A
+-lowering-+.f64N/A
neg-sub0N/A
sub-negN/A
+-commutativeN/A
associate--r+N/A
neg-sub0N/A
remove-double-negN/A
--lowering--.f6499.7%
Applied egg-rr99.7%
(FPCore (x y z t) :precision binary64 (* x (/ 0.5 t)))
double code(double x, double y, double z, double t) {
return x * (0.5 / t);
}
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 * (0.5d0 / t)
end function
public static double code(double x, double y, double z, double t) {
return x * (0.5 / t);
}
def code(x, y, z, t): return x * (0.5 / t)
function code(x, y, z, t) return Float64(x * Float64(0.5 / t)) end
function tmp = code(x, y, z, t) tmp = x * (0.5 / t); end
code[x_, y_, z_, t_] := N[(x * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{0.5}{t}
\end{array}
Initial program 100.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f6436.8%
Simplified36.8%
herbie shell --seed 2024152
(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)))