
(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 + 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 -1.7e+90) (/ (* x 0.5) t) (if (<= x -1.65e-307) (/ (* z -0.5) t) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.7e+90) {
tmp = (x * 0.5) / t;
} else if (x <= -1.65e-307) {
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 <= (-1.7d+90)) then
tmp = (x * 0.5d0) / t
else if (x <= (-1.65d-307)) 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 <= -1.7e+90) {
tmp = (x * 0.5) / t;
} else if (x <= -1.65e-307) {
tmp = (z * -0.5) / t;
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.7e+90: tmp = (x * 0.5) / t elif x <= -1.65e-307: tmp = (z * -0.5) / t else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.7e+90) tmp = Float64(Float64(x * 0.5) / t); elseif (x <= -1.65e-307) 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 <= -1.7e+90) tmp = (x * 0.5) / t; elseif (x <= -1.65e-307) tmp = (z * -0.5) / t; else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.7e+90], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[x, -1.65e-307], 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 \leq -1.7 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{elif}\;x \leq -1.65 \cdot 10^{-307}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if x < -1.70000000000000009e90Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.7%
Simplified80.7%
if -1.70000000000000009e90 < x < -1.65e-307Initial 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-*.f6468.5%
Simplified68.5%
if -1.65e-307 < x Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6442.7%
Simplified42.7%
Final simplification58.3%
(FPCore (x y z t) :precision binary64 (if (<= x -5.8e+56) (/ (- x z) (* t 2.0)) (/ (- y z) (* t 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.8e+56) {
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 <= (-5.8d+56)) 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 <= -5.8e+56) {
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 <= -5.8e+56: 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 <= -5.8e+56) 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 <= -5.8e+56) 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, -5.8e+56], 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 -5.8 \cdot 10^{+56}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{t \cdot 2}\\
\end{array}
\end{array}
if x < -5.80000000000000014e56Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6498.3%
Simplified98.3%
if -5.80000000000000014e56 < x Initial program 100.0%
Taylor expanded in x around 0
--lowering--.f6481.3%
Simplified81.3%
(FPCore (x y z t) :precision binary64 (if (<= x -4.5e+55) (/ (- x z) (* t 2.0)) (/ 0.5 (/ t (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.5e+55) {
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 (x <= (-4.5d+55)) 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 (x <= -4.5e+55) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = 0.5 / (t / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.5e+55: 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 (x <= -4.5e+55) tmp = Float64(Float64(x - z) / Float64(t * 2.0)); else tmp = Float64(0.5 / Float64(t / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.5e+55) 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[x, -4.5e+55], N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+55}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{t}{y - z}}\\
\end{array}
\end{array}
if x < -4.49999999999999998e55Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6498.3%
Simplified98.3%
if -4.49999999999999998e55 < x 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 x around 0
/-lowering-/.f64N/A
--lowering--.f6481.0%
Simplified81.0%
(FPCore (x y z t) :precision binary64 (if (<= x -5.5e+100) (/ (+ x y) (* t 2.0)) (/ 0.5 (/ t (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.5e+100) {
tmp = (x + y) / (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 (x <= (-5.5d+100)) then
tmp = (x + y) / (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 (x <= -5.5e+100) {
tmp = (x + y) / (t * 2.0);
} else {
tmp = 0.5 / (t / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.5e+100: tmp = (x + y) / (t * 2.0) else: tmp = 0.5 / (t / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.5e+100) tmp = Float64(Float64(x + y) / Float64(t * 2.0)); else tmp = Float64(0.5 / Float64(t / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.5e+100) tmp = (x + y) / (t * 2.0); else tmp = 0.5 / (t / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.5e+100], N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+100}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{t}{y - z}}\\
\end{array}
\end{array}
if x < -5.5000000000000002e100Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
+-lowering-+.f6484.5%
Simplified84.5%
if -5.5000000000000002e100 < x 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 x around 0
/-lowering-/.f64N/A
--lowering--.f6480.4%
Simplified80.4%
Final simplification81.1%
(FPCore (x y z t) :precision binary64 (if (<= x -5.4e+103) (/ (* x 0.5) t) (/ 0.5 (/ t (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.4e+103) {
tmp = (x * 0.5) / t;
} 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 (x <= (-5.4d+103)) then
tmp = (x * 0.5d0) / t
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 (x <= -5.4e+103) {
tmp = (x * 0.5) / t;
} else {
tmp = 0.5 / (t / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.4e+103: tmp = (x * 0.5) / t else: tmp = 0.5 / (t / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.4e+103) tmp = Float64(Float64(x * 0.5) / t); else tmp = Float64(0.5 / Float64(t / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.4e+103) tmp = (x * 0.5) / t; else tmp = 0.5 / (t / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.4e+103], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], N[(0.5 / N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{+103}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{t}{y - z}}\\
\end{array}
\end{array}
if x < -5.39999999999999985e103Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6482.5%
Simplified82.5%
if -5.39999999999999985e103 < x 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 x around 0
/-lowering-/.f64N/A
--lowering--.f6480.4%
Simplified80.4%
Final simplification80.8%
(FPCore (x y z t) :precision binary64 (if (<= x -1.42e+51) (/ (* x 0.5) t) (/ (* y 0.5) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.42e+51) {
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 (x <= (-1.42d+51)) 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 (x <= -1.42e+51) {
tmp = (x * 0.5) / t;
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.42e+51: tmp = (x * 0.5) / t else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.42e+51) tmp = Float64(Float64(x * 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 <= -1.42e+51) tmp = (x * 0.5) / t; else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.42e+51], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], N[(N[(y * 0.5), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.42 \cdot 10^{+51}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if x < -1.41999999999999998e51Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6474.8%
Simplified74.8%
if -1.41999999999999998e51 < x Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6440.1%
Simplified40.1%
Final simplification47.6%
(FPCore (x y z t) :precision binary64 (if (<= x -6.8e+52) (/ (* x 0.5) t) (/ 0.5 (/ t y))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.8e+52) {
tmp = (x * 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 (x <= (-6.8d+52)) then
tmp = (x * 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 (x <= -6.8e+52) {
tmp = (x * 0.5) / t;
} else {
tmp = 0.5 / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.8e+52: tmp = (x * 0.5) / t else: tmp = 0.5 / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.8e+52) tmp = Float64(Float64(x * 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 (x <= -6.8e+52) tmp = (x * 0.5) / t; else tmp = 0.5 / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.8e+52], N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision], N[(0.5 / N[(t / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+52}:\\
\;\;\;\;\frac{x \cdot 0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{t}{y}}\\
\end{array}
\end{array}
if x < -6.8e52Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6474.8%
Simplified74.8%
if -6.8e52 < x 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-/.f6440.0%
Simplified40.0%
Final simplification47.5%
(FPCore (x y z t) :precision binary64 (if (<= x -5.2e+50) (/ 0.5 (/ t x)) (/ 0.5 (/ t y))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.2e+50) {
tmp = 0.5 / (t / x);
} 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 (x <= (-5.2d+50)) then
tmp = 0.5d0 / (t / x)
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 (x <= -5.2e+50) {
tmp = 0.5 / (t / x);
} else {
tmp = 0.5 / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.2e+50: tmp = 0.5 / (t / x) else: tmp = 0.5 / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.2e+50) tmp = Float64(0.5 / Float64(t / x)); else tmp = Float64(0.5 / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.2e+50) tmp = 0.5 / (t / x); else tmp = 0.5 / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.2e+50], N[(0.5 / N[(t / x), $MachinePrecision]), $MachinePrecision], N[(0.5 / N[(t / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+50}:\\
\;\;\;\;\frac{0.5}{\frac{t}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{t}{y}}\\
\end{array}
\end{array}
if x < -5.2000000000000004e50Initial program 100.0%
Taylor expanded in x around inf
*-commutativeN/A
associate-*l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6474.8%
Simplified74.8%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6474.6%
Applied egg-rr74.6%
if -5.2000000000000004e50 < x 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-/.f6440.0%
Simplified40.0%
(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.7%
Applied egg-rr99.7%
(FPCore (x y z t) :precision binary64 (/ 0.5 (/ t x)))
double code(double x, double y, double z, double t) {
return 0.5 / (t / x);
}
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)
end function
public static double code(double x, double y, double z, double t) {
return 0.5 / (t / x);
}
def code(x, y, z, t): return 0.5 / (t / x)
function code(x, y, z, t) return Float64(0.5 / Float64(t / x)) end
function tmp = code(x, y, z, t) tmp = 0.5 / (t / x); end
code[x_, y_, z_, t_] := N[(0.5 / N[(t / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5}{\frac{t}{x}}
\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.6%
Simplified35.6%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6435.5%
Applied egg-rr35.5%
(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.6%
Simplified35.6%
clear-numN/A
associate-/r/N/A
associate-*r*N/A
metadata-evalN/A
div-invN/A
*-lowering-*.f64N/A
associate-/l/N/A
associate-/r*N/A
metadata-evalN/A
/-lowering-/.f6435.4%
Applied egg-rr35.4%
Final simplification35.4%
herbie shell --seed 2024161
(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)))