
(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 9 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 (<= (+ x y) -2e-31) (/ (* x 0.5) t) (if (<= (+ x y) 5000000.0) (/ (* z -0.5) t) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -2e-31) {
tmp = (x * 0.5) / t;
} else if ((x + y) <= 5000000.0) {
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 + y) <= (-2d-31)) then
tmp = (x * 0.5d0) / t
else if ((x + y) <= 5000000.0d0) 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 + y) <= -2e-31) {
tmp = (x * 0.5) / t;
} else if ((x + y) <= 5000000.0) {
tmp = (z * -0.5) / t;
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -2e-31: tmp = (x * 0.5) / t elif (x + y) <= 5000000.0: tmp = (z * -0.5) / t else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -2e-31) tmp = Float64(Float64(x * 0.5) / t); elseif (Float64(x + y) <= 5000000.0) 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 ((x + y) <= -2e-31) tmp = (x * 0.5) / t; elseif ((x + y) <= 5000000.0) tmp = (z * -0.5) / t; else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -2e-31], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 5000000.0], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(N[(y * 0.5), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -2 \cdot 10^{-31}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{elif}\;x + y \leq 5000000:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if (+.f64 x y) < -2e-31Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6442.4
Simplified42.4%
if -2e-31 < (+.f64 x y) < 5e6Initial program 100.0%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.0
Simplified80.0%
if 5e6 < (+.f64 x y) Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6440.4
Simplified40.4%
Final simplification50.3%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -2e-31) (/ (* x 0.5) t) (if (<= (+ x y) 5000000.0) (* z (/ -0.5 t)) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -2e-31) {
tmp = (x * 0.5) / t;
} else if ((x + y) <= 5000000.0) {
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 + y) <= (-2d-31)) then
tmp = (x * 0.5d0) / t
else if ((x + y) <= 5000000.0d0) 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 + y) <= -2e-31) {
tmp = (x * 0.5) / t;
} else if ((x + y) <= 5000000.0) {
tmp = z * (-0.5 / t);
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -2e-31: tmp = (x * 0.5) / t elif (x + y) <= 5000000.0: tmp = z * (-0.5 / t) else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -2e-31) tmp = Float64(Float64(x * 0.5) / t); elseif (Float64(x + y) <= 5000000.0) 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 ((x + y) <= -2e-31) tmp = (x * 0.5) / t; elseif ((x + y) <= 5000000.0) tmp = z * (-0.5 / t); else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -2e-31], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 5000000.0], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision], N[(N[(y * 0.5), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -2 \cdot 10^{-31}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{elif}\;x + y \leq 5000000:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if (+.f64 x y) < -2e-31Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6442.4
Simplified42.4%
if -2e-31 < (+.f64 x y) < 5e6Initial program 100.0%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.0
Simplified80.0%
associate-/l*N/A
*-commutativeN/A
clear-numN/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
div-invN/A
clear-numN/A
/-lowering-/.f6479.6
Applied egg-rr79.6%
if 5e6 < (+.f64 x y) Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6440.4
Simplified40.4%
Final simplification50.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* z -0.5) t))) (if (<= z -1.02e+89) t_1 (if (<= z 2.4e+79) (/ (+ 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 <= -1.02e+89) {
tmp = t_1;
} else if (z <= 2.4e+79) {
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 <= (-1.02d+89)) then
tmp = t_1
else if (z <= 2.4d+79) 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 <= -1.02e+89) {
tmp = t_1;
} else if (z <= 2.4e+79) {
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 <= -1.02e+89: tmp = t_1 elif z <= 2.4e+79: 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 <= -1.02e+89) tmp = t_1; elseif (z <= 2.4e+79) tmp = Float64(Float64(x + y) / Float64(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 <= -1.02e+89) tmp = t_1; elseif (z <= 2.4e+79) 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, -1.02e+89], t$95$1, If[LessEqual[z, 2.4e+79], N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot -0.5}{t}\\
\mathbf{if}\;z \leq -1.02 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+79}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.0199999999999999e89 or 2.39999999999999986e79 < z Initial program 100.0%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6475.8
Simplified75.8%
if -1.0199999999999999e89 < z < 2.39999999999999986e79Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f6485.7
Simplified85.7%
Final simplification81.7%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -2e-201) (/ (- 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) <= -2e-201) {
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) <= (-2d-201)) 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) <= -2e-201) {
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) <= -2e-201: 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) <= -2e-201) 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 + y) <= -2e-201) 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], -2e-201], 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 + y \leq -2 \cdot 10^{-201}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{t \cdot 2}\\
\end{array}
\end{array}
if (+.f64 x y) < -1.99999999999999989e-201Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6468.5
Simplified68.5%
if -1.99999999999999989e-201 < (+.f64 x y) Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f6471.8
Simplified71.8%
(FPCore (x y z t) :precision binary64 (if (<= y 60000000.0) (/ (- x z) (* t 2.0)) (/ (+ x y) (* t 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 60000000.0) {
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 (y <= 60000000.0d0) 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 (y <= 60000000.0) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = (x + y) / (t * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 60000000.0: 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 (y <= 60000000.0) tmp = Float64(Float64(x - z) / Float64(t * 2.0)); else tmp = Float64(Float64(x + y) / Float64(t * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 60000000.0) 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[y, 60000000.0], N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 60000000:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\end{array}
\end{array}
if y < 6e7Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6479.1
Simplified79.1%
if 6e7 < y Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f6484.0
Simplified84.0%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -2e-31) (/ (* x 0.5) t) (* z (/ -0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -2e-31) {
tmp = (x * 0.5) / t;
} else {
tmp = 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 + y) <= (-2d-31)) then
tmp = (x * 0.5d0) / t
else
tmp = 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 + y) <= -2e-31) {
tmp = (x * 0.5) / t;
} else {
tmp = z * (-0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -2e-31: tmp = (x * 0.5) / t else: tmp = z * (-0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -2e-31) tmp = Float64(Float64(x * 0.5) / t); else tmp = Float64(z * Float64(-0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= -2e-31) tmp = (x * 0.5) / t; else tmp = z * (-0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -2e-31], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -2 \cdot 10^{-31}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\end{array}
\end{array}
if (+.f64 x y) < -2e-31Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6442.4
Simplified42.4%
if -2e-31 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6450.6
Simplified50.6%
associate-/l*N/A
*-commutativeN/A
clear-numN/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
div-invN/A
clear-numN/A
/-lowering-/.f6450.4
Applied egg-rr50.4%
Final simplification47.3%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -2e-31) (* x (/ 0.5 t)) (* z (/ -0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -2e-31) {
tmp = x * (0.5 / t);
} else {
tmp = 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 + y) <= (-2d-31)) then
tmp = x * (0.5d0 / t)
else
tmp = 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 + y) <= -2e-31) {
tmp = x * (0.5 / t);
} else {
tmp = z * (-0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -2e-31: tmp = x * (0.5 / t) else: tmp = z * (-0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -2e-31) tmp = Float64(x * Float64(0.5 / t)); else tmp = Float64(z * Float64(-0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= -2e-31) tmp = x * (0.5 / t); else tmp = z * (-0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -2e-31], N[(x * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -2 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\end{array}
\end{array}
if (+.f64 x y) < -2e-31Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6442.4
Simplified42.4%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6442.3
Applied egg-rr42.3%
if -2e-31 < (+.f64 x y) Initial program 100.0%
Taylor expanded in z around inf
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6450.6
Simplified50.6%
associate-/l*N/A
*-commutativeN/A
clear-numN/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
distribute-rgt-neg-inN/A
metadata-evalN/A
metadata-evalN/A
div-invN/A
clear-numN/A
/-lowering-/.f6450.4
Applied egg-rr50.4%
Final simplification47.2%
(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-*.f6436.4
Simplified36.4%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6436.3
Applied egg-rr36.3%
herbie shell --seed 2024204
(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)))