
(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 12 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 + Float64(y - z)) / 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 + N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x + \left(y - z\right)}{t}}{2}
\end{array}
Initial program 99.6%
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%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* z -0.5) t))) (if (<= z -3.7e+85) t_1 (if (<= z 1.44e+169) (/ (/ (+ x y) t) 2.0) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z * -0.5) / t;
double tmp;
if (z <= -3.7e+85) {
tmp = t_1;
} else if (z <= 1.44e+169) {
tmp = ((x + y) / t) / 2.0;
} else {
tmp = t_1;
}
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 = (z * (-0.5d0)) / t
if (z <= (-3.7d+85)) then
tmp = t_1
else if (z <= 1.44d+169) then
tmp = ((x + y) / t) / 2.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * -0.5) / t;
double tmp;
if (z <= -3.7e+85) {
tmp = t_1;
} else if (z <= 1.44e+169) {
tmp = ((x + y) / t) / 2.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * -0.5) / t tmp = 0 if z <= -3.7e+85: tmp = t_1 elif z <= 1.44e+169: tmp = ((x + y) / t) / 2.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * -0.5) / t) tmp = 0.0 if (z <= -3.7e+85) tmp = t_1; elseif (z <= 1.44e+169) tmp = Float64(Float64(Float64(x + y) / t) / 2.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * -0.5) / t; tmp = 0.0; if (z <= -3.7e+85) tmp = t_1; elseif (z <= 1.44e+169) tmp = ((x + y) / t) / 2.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -3.7e+85], t$95$1, If[LessEqual[z, 1.44e+169], N[(N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision] / 2.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot -0.5}{t}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.44 \cdot 10^{+169}:\\
\;\;\;\;\frac{\frac{x + y}{t}}{2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.7000000000000002e85 or 1.44e169 < z Initial program 98.6%
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 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-*.f6472.4%
Simplified72.4%
if -3.7000000000000002e85 < z < 1.44e169Initial 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 0
*-lft-identityN/A
metadata-evalN/A
associate-*r*N/A
*-lft-identityN/A
metadata-evalN/A
associate-*r*N/A
distribute-lft-outN/A
distribute-lft-inN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
neg-mul-1N/A
/-lowering-/.f64N/A
Simplified88.5%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* z -0.5) t))) (if (<= z -2.8e+86) t_1 (if (<= z 5.9e+168) (* (/ 0.5 t) (+ x y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z * -0.5) / t;
double tmp;
if (z <= -2.8e+86) {
tmp = t_1;
} else if (z <= 5.9e+168) {
tmp = (0.5 / t) * (x + y);
} else {
tmp = t_1;
}
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 = (z * (-0.5d0)) / t
if (z <= (-2.8d+86)) then
tmp = t_1
else if (z <= 5.9d+168) then
tmp = (0.5d0 / t) * (x + y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * -0.5) / t;
double tmp;
if (z <= -2.8e+86) {
tmp = t_1;
} else if (z <= 5.9e+168) {
tmp = (0.5 / t) * (x + y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * -0.5) / t tmp = 0 if z <= -2.8e+86: tmp = t_1 elif z <= 5.9e+168: tmp = (0.5 / t) * (x + y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * -0.5) / t) tmp = 0.0 if (z <= -2.8e+86) tmp = t_1; elseif (z <= 5.9e+168) tmp = Float64(Float64(0.5 / t) * Float64(x + y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * -0.5) / t; tmp = 0.0; if (z <= -2.8e+86) tmp = t_1; elseif (z <= 5.9e+168) tmp = (0.5 / t) * (x + y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -2.8e+86], t$95$1, If[LessEqual[z, 5.9e+168], N[(N[(0.5 / t), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot -0.5}{t}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{+168}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.80000000000000004e86 or 5.89999999999999986e168 < z Initial program 98.6%
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 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-*.f6472.4%
Simplified72.4%
if -2.80000000000000004e86 < z < 5.89999999999999986e168Initial 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 z around 0
+-commutativeN/A
+-lowering-+.f6488.4%
Simplified88.4%
Final simplification84.0%
(FPCore (x y z t) :precision binary64 (if (<= x -2.5e+64) (/ (/ x t) 2.0) (if (<= x -4.8e-110) (/ (* z -0.5) t) (/ (/ y t) 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.5e+64) {
tmp = (x / t) / 2.0;
} else if (x <= -4.8e-110) {
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 (x <= (-2.5d+64)) then
tmp = (x / t) / 2.0d0
else if (x <= (-4.8d-110)) 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 (x <= -2.5e+64) {
tmp = (x / t) / 2.0;
} else if (x <= -4.8e-110) {
tmp = (z * -0.5) / t;
} else {
tmp = (y / t) / 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.5e+64: tmp = (x / t) / 2.0 elif x <= -4.8e-110: tmp = (z * -0.5) / t else: tmp = (y / t) / 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.5e+64) tmp = Float64(Float64(x / t) / 2.0); elseif (x <= -4.8e-110) 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 (x <= -2.5e+64) tmp = (x / t) / 2.0; elseif (x <= -4.8e-110) tmp = (z * -0.5) / t; else tmp = (y / t) / 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.5e+64], N[(N[(x / t), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -4.8e-110], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(N[(y / t), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+64}:\\
\;\;\;\;\frac{\frac{x}{t}}{2}\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-110}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{t}}{2}\\
\end{array}
\end{array}
if x < -2.5e64Initial 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-/.f6487.2%
Simplified87.2%
if -2.5e64 < x < -4.80000000000000013e-110Initial 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 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-*.f6443.8%
Simplified43.8%
if -4.80000000000000013e-110 < x Initial program 99.4%
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-/.f6446.9%
Simplified46.9%
(FPCore (x y z t) :precision binary64 (if (<= x -2.5e+64) (/ (/ x t) 2.0) (if (<= x -3.5e-110) (/ (* z -0.5) t) (* y (/ 0.5 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.5e+64) {
tmp = (x / t) / 2.0;
} else if (x <= -3.5e-110) {
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 (x <= (-2.5d+64)) then
tmp = (x / t) / 2.0d0
else if (x <= (-3.5d-110)) 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 (x <= -2.5e+64) {
tmp = (x / t) / 2.0;
} else if (x <= -3.5e-110) {
tmp = (z * -0.5) / t;
} else {
tmp = y * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.5e+64: tmp = (x / t) / 2.0 elif x <= -3.5e-110: tmp = (z * -0.5) / t else: tmp = y * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.5e+64) tmp = Float64(Float64(x / t) / 2.0); elseif (x <= -3.5e-110) 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 (x <= -2.5e+64) tmp = (x / t) / 2.0; elseif (x <= -3.5e-110) tmp = (z * -0.5) / t; else tmp = y * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.5e+64], N[(N[(x / t), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -3.5e-110], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(y * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+64}:\\
\;\;\;\;\frac{\frac{x}{t}}{2}\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-110}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -2.5e64Initial 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-/.f6487.2%
Simplified87.2%
if -2.5e64 < x < -3.49999999999999974e-110Initial 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 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-*.f6443.8%
Simplified43.8%
if -3.49999999999999974e-110 < x Initial program 99.4%
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.6%
Applied egg-rr99.6%
Taylor expanded in y around inf
Simplified46.8%
Final simplification52.9%
(FPCore (x y z t) :precision binary64 (if (<= x -2.6e+64) (/ 0.5 (/ t x)) (if (<= x -4e-110) (/ (* z -0.5) t) (* y (/ 0.5 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.6e+64) {
tmp = 0.5 / (t / x);
} else if (x <= -4e-110) {
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 (x <= (-2.6d+64)) then
tmp = 0.5d0 / (t / x)
else if (x <= (-4d-110)) 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 (x <= -2.6e+64) {
tmp = 0.5 / (t / x);
} else if (x <= -4e-110) {
tmp = (z * -0.5) / t;
} else {
tmp = y * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.6e+64: tmp = 0.5 / (t / x) elif x <= -4e-110: tmp = (z * -0.5) / t else: tmp = y * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.6e+64) tmp = Float64(0.5 / Float64(t / x)); elseif (x <= -4e-110) 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 (x <= -2.6e+64) tmp = 0.5 / (t / x); elseif (x <= -4e-110) tmp = (z * -0.5) / t; else tmp = y * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.6e+64], N[(0.5 / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4e-110], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(y * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+64}:\\
\;\;\;\;\frac{0.5}{\frac{t}{x}}\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-110}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -2.59999999999999997e64Initial 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-/.f6487.2%
Simplified87.2%
div-invN/A
clear-numN/A
metadata-evalN/A
associate-*l/N/A
metadata-evalN/A
/-lowering-/.f64N/A
/-lowering-/.f6487.0%
Applied egg-rr87.0%
if -2.59999999999999997e64 < x < -4.0000000000000002e-110Initial 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 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-*.f6443.8%
Simplified43.8%
if -4.0000000000000002e-110 < x Initial program 99.4%
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.6%
Applied egg-rr99.6%
Taylor expanded in y around inf
Simplified46.8%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (if (<= x -3.6e+64) (/ 0.5 (/ t x)) (if (<= x -3.3e-110) (* z (/ -0.5 t)) (* y (/ 0.5 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.6e+64) {
tmp = 0.5 / (t / x);
} else if (x <= -3.3e-110) {
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 (x <= (-3.6d+64)) then
tmp = 0.5d0 / (t / x)
else if (x <= (-3.3d-110)) 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 (x <= -3.6e+64) {
tmp = 0.5 / (t / x);
} else if (x <= -3.3e-110) {
tmp = z * (-0.5 / t);
} else {
tmp = y * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.6e+64: tmp = 0.5 / (t / x) elif x <= -3.3e-110: tmp = z * (-0.5 / t) else: tmp = y * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.6e+64) tmp = Float64(0.5 / Float64(t / x)); elseif (x <= -3.3e-110) tmp = Float64(z * 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 (x <= -3.6e+64) tmp = 0.5 / (t / x); elseif (x <= -3.3e-110) tmp = z * (-0.5 / t); else tmp = y * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.6e+64], N[(0.5 / N[(t / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.3e-110], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision], N[(y * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+64}:\\
\;\;\;\;\frac{0.5}{\frac{t}{x}}\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-110}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -3.60000000000000014e64Initial 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-/.f6487.2%
Simplified87.2%
div-invN/A
clear-numN/A
metadata-evalN/A
associate-*l/N/A
metadata-evalN/A
/-lowering-/.f64N/A
/-lowering-/.f6487.0%
Applied egg-rr87.0%
if -3.60000000000000014e64 < x < -3.2999999999999999e-110Initial 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 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-*.f6443.8%
Simplified43.8%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6443.7%
Applied egg-rr43.7%
if -3.2999999999999999e-110 < x Initial program 99.4%
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.6%
Applied egg-rr99.6%
Taylor expanded in y around inf
Simplified46.8%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (/ -0.5 t)))) (if (<= z -128000.0) t_1 (if (<= z 7.3e+50) (* y (/ 0.5 t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = z * (-0.5 / t);
double tmp;
if (z <= -128000.0) {
tmp = t_1;
} else if (z <= 7.3e+50) {
tmp = y * (0.5 / t);
} else {
tmp = t_1;
}
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 = z * ((-0.5d0) / t)
if (z <= (-128000.0d0)) then
tmp = t_1
else if (z <= 7.3d+50) then
tmp = y * (0.5d0 / t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (-0.5 / t);
double tmp;
if (z <= -128000.0) {
tmp = t_1;
} else if (z <= 7.3e+50) {
tmp = y * (0.5 / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (-0.5 / t) tmp = 0 if z <= -128000.0: tmp = t_1 elif z <= 7.3e+50: tmp = y * (0.5 / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-0.5 / t)) tmp = 0.0 if (z <= -128000.0) tmp = t_1; elseif (z <= 7.3e+50) tmp = Float64(y * Float64(0.5 / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (-0.5 / t); tmp = 0.0; if (z <= -128000.0) tmp = t_1; elseif (z <= 7.3e+50) tmp = y * (0.5 / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -128000.0], t$95$1, If[LessEqual[z, 7.3e+50], N[(y * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{-0.5}{t}\\
\mathbf{if}\;z \leq -128000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.3 \cdot 10^{+50}:\\
\;\;\;\;y \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -128000 or 7.3000000000000003e50 < z Initial program 99.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-*.f6461.6%
Simplified61.6%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6461.3%
Applied egg-rr61.3%
if -128000 < z < 7.3000000000000003e50Initial 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.7%
Applied egg-rr99.7%
Taylor expanded in y around inf
Simplified51.5%
Final simplification55.6%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -1e-113) (/ (/ (- x z) t) 2.0) (/ (/ (- y z) t) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -1e-113) {
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 ((x + y) <= (-1d-113)) 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 ((x + y) <= -1e-113) {
tmp = ((x - z) / t) / 2.0;
} else {
tmp = ((y - z) / t) / 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -1e-113: 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 (Float64(x + y) <= -1e-113) 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 ((x + y) <= -1e-113) 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[N[(x + y), $MachinePrecision], -1e-113], 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}\;x + y \leq -1 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{x - z}{t}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y - z}{t}}{2}\\
\end{array}
\end{array}
if (+.f64 x y) < -9.99999999999999979e-114Initial 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 y around 0
/-lowering-/.f64N/A
--lowering--.f6462.7%
Simplified62.7%
if -9.99999999999999979e-114 < (+.f64 x y) Initial program 99.4%
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--.f6472.2%
Simplified72.2%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) 1.3e-52) (/ (/ (- x z) t) 2.0) (/ (/ (+ x y) t) 2.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= 1.3e-52) {
tmp = ((x - z) / t) / 2.0;
} else {
tmp = ((x + 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 ((x + y) <= 1.3d-52) then
tmp = ((x - z) / t) / 2.0d0
else
tmp = ((x + 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 ((x + y) <= 1.3e-52) {
tmp = ((x - z) / t) / 2.0;
} else {
tmp = ((x + y) / t) / 2.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= 1.3e-52: tmp = ((x - z) / t) / 2.0 else: tmp = ((x + y) / t) / 2.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= 1.3e-52) tmp = Float64(Float64(Float64(x - z) / t) / 2.0); else tmp = Float64(Float64(Float64(x + y) / t) / 2.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= 1.3e-52) tmp = ((x - z) / t) / 2.0; else tmp = ((x + y) / t) / 2.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], 1.3e-52], N[(N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 1.3 \cdot 10^{-52}:\\
\;\;\;\;\frac{\frac{x - z}{t}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x + y}{t}}{2}\\
\end{array}
\end{array}
if (+.f64 x y) < 1.2999999999999999e-52Initial 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 y around 0
/-lowering-/.f64N/A
--lowering--.f6470.3%
Simplified70.3%
if 1.2999999999999999e-52 < (+.f64 x y) Initial program 99.2%
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 0
*-lft-identityN/A
metadata-evalN/A
associate-*r*N/A
*-lft-identityN/A
metadata-evalN/A
associate-*r*N/A
distribute-lft-outN/A
distribute-lft-inN/A
*-rgt-identityN/A
*-inversesN/A
associate-/l*N/A
associate-*l/N/A
associate-*r/N/A
*-commutativeN/A
neg-mul-1N/A
/-lowering-/.f64N/A
Simplified77.6%
Final simplification73.8%
(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 99.6%
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 (* z (/ -0.5 t)))
double code(double x, double y, double z, double t) {
return z * (-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 = z * ((-0.5d0) / t)
end function
public static double code(double x, double y, double z, double t) {
return z * (-0.5 / t);
}
def code(x, y, z, t): return z * (-0.5 / t)
function code(x, y, z, t) return Float64(z * Float64(-0.5 / t)) end
function tmp = code(x, y, z, t) tmp = z * (-0.5 / t); end
code[x_, y_, z_, t_] := N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \frac{-0.5}{t}
\end{array}
Initial program 99.6%
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-*.f6435.0%
Simplified35.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6434.9%
Applied egg-rr34.9%
Final simplification34.9%
herbie shell --seed 2024138
(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)))