
(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 14 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 (/ 0.5 (/ t (- y z))))) (if (<= z -3.5e+38) t_1 (if (<= z 3.9e-34) (* (+ x y) (/ 0.5 t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = 0.5 / (t / (y - z));
double tmp;
if (z <= -3.5e+38) {
tmp = t_1;
} else if (z <= 3.9e-34) {
tmp = (x + 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 = 0.5d0 / (t / (y - z))
if (z <= (-3.5d+38)) then
tmp = t_1
else if (z <= 3.9d-34) then
tmp = (x + 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 = 0.5 / (t / (y - z));
double tmp;
if (z <= -3.5e+38) {
tmp = t_1;
} else if (z <= 3.9e-34) {
tmp = (x + y) * (0.5 / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 0.5 / (t / (y - z)) tmp = 0 if z <= -3.5e+38: tmp = t_1 elif z <= 3.9e-34: tmp = (x + y) * (0.5 / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(0.5 / Float64(t / Float64(y - z))) tmp = 0.0 if (z <= -3.5e+38) tmp = t_1; elseif (z <= 3.9e-34) tmp = Float64(Float64(x + y) * Float64(0.5 / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 0.5 / (t / (y - z)); tmp = 0.0; if (z <= -3.5e+38) tmp = t_1; elseif (z <= 3.9e-34) tmp = (x + y) * (0.5 / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e+38], t$95$1, If[LessEqual[z, 3.9e-34], N[(N[(x + y), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{0.5}{\frac{t}{y - z}}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-34}:\\
\;\;\;\;\left(x + y\right) \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.50000000000000002e38 or 3.89999999999999991e-34 < z Initial program 100.0%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-lowering-+.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
--lowering--.f6485.6%
Simplified85.6%
if -3.50000000000000002e38 < z < 3.89999999999999991e-34Initial program 100.0%
Taylor expanded in z around 0
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6492.3%
Simplified92.3%
Final simplification88.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* z -0.5) t))) (if (<= z -3.5e+97) t_1 (if (<= z 1.45e+164) (* (+ x 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 <= -3.5e+97) {
tmp = t_1;
} else if (z <= 1.45e+164) {
tmp = (x + 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 <= (-3.5d+97)) then
tmp = t_1
else if (z <= 1.45d+164) then
tmp = (x + 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 <= -3.5e+97) {
tmp = t_1;
} else if (z <= 1.45e+164) {
tmp = (x + 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 <= -3.5e+97: tmp = t_1 elif z <= 1.45e+164: tmp = (x + y) * (0.5 / t) 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.5e+97) tmp = t_1; elseif (z <= 1.45e+164) tmp = Float64(Float64(x + 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 <= -3.5e+97) tmp = t_1; elseif (z <= 1.45e+164) tmp = (x + y) * (0.5 / t); 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.5e+97], t$95$1, If[LessEqual[z, 1.45e+164], N[(N[(x + y), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot -0.5}{t}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+164}:\\
\;\;\;\;\left(x + y\right) \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5000000000000001e97 or 1.4499999999999999e164 < z Initial program 100.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-*.f6478.0%
Simplified78.0%
if -3.5000000000000001e97 < z < 1.4499999999999999e164Initial program 100.0%
Taylor expanded in z around 0
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6481.9%
Simplified81.9%
Final simplification80.7%
(FPCore (x y z t) :precision binary64 (if (<= y -7.5e-263) (/ (* x 0.5) t) (if (<= y 1.8e+60) (/ (* z -0.5) t) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e-263) {
tmp = (x * 0.5) / t;
} else if (y <= 1.8e+60) {
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 <= (-7.5d-263)) then
tmp = (x * 0.5d0) / t
else if (y <= 1.8d+60) 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 <= -7.5e-263) {
tmp = (x * 0.5) / t;
} else if (y <= 1.8e+60) {
tmp = (z * -0.5) / t;
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.5e-263: tmp = (x * 0.5) / t elif y <= 1.8e+60: tmp = (z * -0.5) / t else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e-263) tmp = Float64(Float64(x * 0.5) / t); elseif (y <= 1.8e+60) tmp = Float64(Float64(z * -0.5) / t); else tmp = Float64(Float64(y * 0.5) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.5e-263) tmp = (x * 0.5) / t; elseif (y <= 1.8e+60) tmp = (z * -0.5) / t; else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e-263], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 1.8e+60], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(N[(y * 0.5), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-263}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+60}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if y < -7.50000000000000044e-263Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6438.8%
Simplified38.8%
if -7.50000000000000044e-263 < y < 1.79999999999999984e60Initial program 100.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-*.f6457.3%
Simplified57.3%
if 1.79999999999999984e60 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6474.8%
Simplified74.8%
Final simplification52.9%
(FPCore (x y z t) :precision binary64 (if (<= y -3e-264) (/ (* x 0.5) t) (if (<= y 1.35e+60) (* z (/ -0.5 t)) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3e-264) {
tmp = (x * 0.5) / t;
} else if (y <= 1.35e+60) {
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 <= (-3d-264)) then
tmp = (x * 0.5d0) / t
else if (y <= 1.35d+60) 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 <= -3e-264) {
tmp = (x * 0.5) / t;
} else if (y <= 1.35e+60) {
tmp = z * (-0.5 / t);
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3e-264: tmp = (x * 0.5) / t elif y <= 1.35e+60: tmp = z * (-0.5 / t) else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3e-264) tmp = Float64(Float64(x * 0.5) / t); elseif (y <= 1.35e+60) tmp = Float64(z * Float64(-0.5 / t)); else tmp = Float64(Float64(y * 0.5) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3e-264) tmp = (x * 0.5) / t; elseif (y <= 1.35e+60) tmp = z * (-0.5 / t); else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3e-264], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 1.35e+60], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision], N[(N[(y * 0.5), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-264}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+60}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if y < -3e-264Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6438.8%
Simplified38.8%
if -3e-264 < y < 1.35e60Initial program 100.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-*.f6457.3%
Simplified57.3%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6457.2%
Applied egg-rr57.2%
if 1.35e60 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6474.8%
Simplified74.8%
Final simplification52.9%
(FPCore (x y z t) :precision binary64 (if (<= y -1.6e-263) (/ (* x 0.5) t) (if (<= y 5.5e+59) (* z (/ -0.5 t)) (/ 0.5 (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e-263) {
tmp = (x * 0.5) / t;
} else if (y <= 5.5e+59) {
tmp = z * (-0.5 / t);
} else {
tmp = 0.5 / (t / y);
}
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.6d-263)) then
tmp = (x * 0.5d0) / t
else if (y <= 5.5d+59) then
tmp = z * ((-0.5d0) / t)
else
tmp = 0.5d0 / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.6e-263) {
tmp = (x * 0.5) / t;
} else if (y <= 5.5e+59) {
tmp = z * (-0.5 / t);
} else {
tmp = 0.5 / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.6e-263: tmp = (x * 0.5) / t elif y <= 5.5e+59: tmp = z * (-0.5 / t) else: tmp = 0.5 / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.6e-263) tmp = Float64(Float64(x * 0.5) / t); elseif (y <= 5.5e+59) tmp = Float64(z * Float64(-0.5 / t)); else tmp = Float64(0.5 / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.6e-263) tmp = (x * 0.5) / t; elseif (y <= 5.5e+59) tmp = z * (-0.5 / t); else tmp = 0.5 / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.6e-263], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 5.5e+59], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-263}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+59}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{t}{y}}\\
\end{array}
\end{array}
if y < -1.6e-263Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6438.8%
Simplified38.8%
if -1.6e-263 < y < 5.4999999999999999e59Initial program 100.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-*.f6457.3%
Simplified57.3%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6457.2%
Applied egg-rr57.2%
if 5.4999999999999999e59 < y Initial program 100.0%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-lowering-+.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around inf
/-lowering-/.f6474.6%
Simplified74.6%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (if (<= y -6.5e-262) (* x (/ 0.5 t)) (if (<= y 4.8e+59) (* z (/ -0.5 t)) (/ 0.5 (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.5e-262) {
tmp = x * (0.5 / t);
} else if (y <= 4.8e+59) {
tmp = z * (-0.5 / t);
} else {
tmp = 0.5 / (t / y);
}
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 <= (-6.5d-262)) then
tmp = x * (0.5d0 / t)
else if (y <= 4.8d+59) then
tmp = z * ((-0.5d0) / t)
else
tmp = 0.5d0 / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.5e-262) {
tmp = x * (0.5 / t);
} else if (y <= 4.8e+59) {
tmp = z * (-0.5 / t);
} else {
tmp = 0.5 / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.5e-262: tmp = x * (0.5 / t) elif y <= 4.8e+59: tmp = z * (-0.5 / t) else: tmp = 0.5 / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.5e-262) tmp = Float64(x * Float64(0.5 / t)); elseif (y <= 4.8e+59) tmp = Float64(z * Float64(-0.5 / t)); else tmp = Float64(0.5 / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.5e-262) tmp = x * (0.5 / t); elseif (y <= 4.8e+59) tmp = z * (-0.5 / t); else tmp = 0.5 / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.5e-262], N[(x * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+59], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{-262}:\\
\;\;\;\;x \cdot \frac{0.5}{t}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+59}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{t}{y}}\\
\end{array}
\end{array}
if y < -6.5000000000000003e-262Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6438.8%
Simplified38.8%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6438.7%
Applied egg-rr38.7%
if -6.5000000000000003e-262 < y < 4.8000000000000004e59Initial program 100.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-*.f6457.3%
Simplified57.3%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6457.2%
Applied egg-rr57.2%
if 4.8000000000000004e59 < y Initial program 100.0%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-lowering-+.f6499.7%
Applied egg-rr99.7%
Taylor expanded in y around inf
/-lowering-/.f6474.6%
Simplified74.6%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ -0.5 (/ t z)))) (if (<= z -6.2e+24) t_1 (if (<= z 2.35e-42) (* x (/ 0.5 t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -0.5 / (t / z);
double tmp;
if (z <= -6.2e+24) {
tmp = t_1;
} else if (z <= 2.35e-42) {
tmp = x * (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 = (-0.5d0) / (t / z)
if (z <= (-6.2d+24)) then
tmp = t_1
else if (z <= 2.35d-42) then
tmp = x * (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 = -0.5 / (t / z);
double tmp;
if (z <= -6.2e+24) {
tmp = t_1;
} else if (z <= 2.35e-42) {
tmp = x * (0.5 / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -0.5 / (t / z) tmp = 0 if z <= -6.2e+24: tmp = t_1 elif z <= 2.35e-42: tmp = x * (0.5 / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-0.5 / Float64(t / z)) tmp = 0.0 if (z <= -6.2e+24) tmp = t_1; elseif (z <= 2.35e-42) tmp = Float64(x * Float64(0.5 / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -0.5 / (t / z); tmp = 0.0; if (z <= -6.2e+24) tmp = t_1; elseif (z <= 2.35e-42) tmp = x * (0.5 / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.5 / N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e+24], t$95$1, If[LessEqual[z, 2.35e-42], N[(x * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-0.5}{\frac{t}{z}}\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-42}:\\
\;\;\;\;x \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.20000000000000022e24 or 2.35e-42 < z Initial program 100.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.3%
Simplified61.3%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6461.1%
Applied egg-rr61.1%
associate-*l/N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6461.2%
Applied egg-rr61.2%
if -6.20000000000000022e24 < z < 2.35e-42Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6453.6%
Simplified53.6%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6453.4%
Applied egg-rr53.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (/ -0.5 t)))) (if (<= z -5.5e+24) t_1 (if (<= z 1.35e-40) (* x (/ 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 <= -5.5e+24) {
tmp = t_1;
} else if (z <= 1.35e-40) {
tmp = x * (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 <= (-5.5d+24)) then
tmp = t_1
else if (z <= 1.35d-40) then
tmp = x * (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 <= -5.5e+24) {
tmp = t_1;
} else if (z <= 1.35e-40) {
tmp = x * (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 <= -5.5e+24: tmp = t_1 elif z <= 1.35e-40: tmp = x * (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 <= -5.5e+24) tmp = t_1; elseif (z <= 1.35e-40) tmp = Float64(x * 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 <= -5.5e+24) tmp = t_1; elseif (z <= 1.35e-40) tmp = x * (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, -5.5e+24], t$95$1, If[LessEqual[z, 1.35e-40], N[(x * 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 -5.5 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-40}:\\
\;\;\;\;x \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.5000000000000002e24 or 1.35e-40 < z Initial program 100.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.3%
Simplified61.3%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6461.1%
Applied egg-rr61.1%
if -5.5000000000000002e24 < z < 1.35e-40Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6453.6%
Simplified53.6%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6453.4%
Applied egg-rr53.4%
Final simplification57.7%
(FPCore (x y z t) :precision binary64 (if (<= x -3.3e-21) (/ (- x z) (* t 2.0)) (/ (- y z) (* t 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.3e-21) {
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 <= (-3.3d-21)) 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 <= -3.3e-21) {
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 <= -3.3e-21: 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 (x <= -3.3e-21) tmp = Float64(Float64(x - z) / Float64(t * 2.0)); else tmp = Float64(Float64(y - z) / Float64(t * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.3e-21) 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[x, -3.3e-21], N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{-21}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{t \cdot 2}\\
\end{array}
\end{array}
if x < -3.30000000000000009e-21Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6480.6%
Simplified80.6%
if -3.30000000000000009e-21 < x Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f6480.4%
Simplified80.4%
(FPCore (x y z t) :precision binary64 (if (<= x -1.4e-18) (/ (- x z) (* t 2.0)) (* (- y z) (/ 0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.4e-18) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = (y - z) * (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 <= (-1.4d-18)) then
tmp = (x - z) / (t * 2.0d0)
else
tmp = (y - z) * (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 <= -1.4e-18) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = (y - z) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.4e-18: tmp = (x - z) / (t * 2.0) else: tmp = (y - z) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.4e-18) tmp = Float64(Float64(x - z) / Float64(t * 2.0)); else tmp = Float64(Float64(y - z) * Float64(0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.4e-18) tmp = (x - z) / (t * 2.0); else tmp = (y - z) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.4e-18], N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-18}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -1.40000000000000006e-18Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6480.6%
Simplified80.6%
if -1.40000000000000006e-18 < x Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f6480.4%
Simplified80.4%
div-invN/A
metadata-evalN/A
div-invN/A
clear-numN/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6480.1%
Applied egg-rr80.1%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (<= x -8.5e+111) (* (+ x y) (/ 0.5 t)) (* (- y z) (/ 0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8.5e+111) {
tmp = (x + y) * (0.5 / t);
} else {
tmp = (y - z) * (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 <= (-8.5d+111)) then
tmp = (x + y) * (0.5d0 / t)
else
tmp = (y - z) * (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 <= -8.5e+111) {
tmp = (x + y) * (0.5 / t);
} else {
tmp = (y - z) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -8.5e+111: tmp = (x + y) * (0.5 / t) else: tmp = (y - z) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -8.5e+111) tmp = Float64(Float64(x + y) * Float64(0.5 / t)); else tmp = Float64(Float64(y - z) * Float64(0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -8.5e+111) tmp = (x + y) * (0.5 / t); else tmp = (y - z) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -8.5e+111], N[(N[(x + y), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+111}:\\
\;\;\;\;\left(x + y\right) \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -8.49999999999999983e111Initial program 100.0%
Taylor expanded in z around 0
associate-*r/N/A
associate-*l/N/A
metadata-evalN/A
associate-*r/N/A
*-lowering-*.f64N/A
associate-*r/N/A
metadata-evalN/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6482.5%
Simplified82.5%
if -8.49999999999999983e111 < x Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f6478.9%
Simplified78.9%
div-invN/A
metadata-evalN/A
div-invN/A
clear-numN/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6478.7%
Applied egg-rr78.7%
Final simplification79.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(0.5 / Float64(t / Float64(Float64(x + y) - z))) end
function tmp = code(x, y, z, t) tmp = 0.5 / (t / ((x + y) - z)); end
code[x_, y_, z_, t_] := N[(0.5 / N[(t / N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5}{\frac{t}{\left(x + y\right) - z}}
\end{array}
Initial program 100.0%
clear-numN/A
*-commutativeN/A
associate-/l*N/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-lowering-+.f6499.4%
Applied egg-rr99.4%
(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%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6435.1%
Simplified35.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6435.0%
Applied egg-rr35.0%
herbie shell --seed 2024158
(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)))