
(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 8 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 (/ (* y 0.5) t)) (t_2 (* 0.5 (/ (- x z) t))))
(if (<= y 1.7e+28)
t_2
(if (<= y 1.3e+55)
t_1
(if (<= y 2.8e+55)
(* 0.5 (/ x t))
(if (or (<= y 1.4e+95)
(not
(or (<= y 1.32e+97)
(and (not (<= y 4.6e+123)) (<= y 2e+145)))))
t_1
t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 0.5) / t;
double t_2 = 0.5 * ((x - z) / t);
double tmp;
if (y <= 1.7e+28) {
tmp = t_2;
} else if (y <= 1.3e+55) {
tmp = t_1;
} else if (y <= 2.8e+55) {
tmp = 0.5 * (x / t);
} else if ((y <= 1.4e+95) || !((y <= 1.32e+97) || (!(y <= 4.6e+123) && (y <= 2e+145)))) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (y * 0.5d0) / t
t_2 = 0.5d0 * ((x - z) / t)
if (y <= 1.7d+28) then
tmp = t_2
else if (y <= 1.3d+55) then
tmp = t_1
else if (y <= 2.8d+55) then
tmp = 0.5d0 * (x / t)
else if ((y <= 1.4d+95) .or. (.not. (y <= 1.32d+97) .or. (.not. (y <= 4.6d+123)) .and. (y <= 2d+145))) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y * 0.5) / t;
double t_2 = 0.5 * ((x - z) / t);
double tmp;
if (y <= 1.7e+28) {
tmp = t_2;
} else if (y <= 1.3e+55) {
tmp = t_1;
} else if (y <= 2.8e+55) {
tmp = 0.5 * (x / t);
} else if ((y <= 1.4e+95) || !((y <= 1.32e+97) || (!(y <= 4.6e+123) && (y <= 2e+145)))) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 0.5) / t t_2 = 0.5 * ((x - z) / t) tmp = 0 if y <= 1.7e+28: tmp = t_2 elif y <= 1.3e+55: tmp = t_1 elif y <= 2.8e+55: tmp = 0.5 * (x / t) elif (y <= 1.4e+95) or not ((y <= 1.32e+97) or (not (y <= 4.6e+123) and (y <= 2e+145))): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 0.5) / t) t_2 = Float64(0.5 * Float64(Float64(x - z) / t)) tmp = 0.0 if (y <= 1.7e+28) tmp = t_2; elseif (y <= 1.3e+55) tmp = t_1; elseif (y <= 2.8e+55) tmp = Float64(0.5 * Float64(x / t)); elseif ((y <= 1.4e+95) || !((y <= 1.32e+97) || (!(y <= 4.6e+123) && (y <= 2e+145)))) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * 0.5) / t; t_2 = 0.5 * ((x - z) / t); tmp = 0.0; if (y <= 1.7e+28) tmp = t_2; elseif (y <= 1.3e+55) tmp = t_1; elseif (y <= 2.8e+55) tmp = 0.5 * (x / t); elseif ((y <= 1.4e+95) || ~(((y <= 1.32e+97) || (~((y <= 4.6e+123)) && (y <= 2e+145))))) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 0.5), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.7e+28], t$95$2, If[LessEqual[y, 1.3e+55], t$95$1, If[LessEqual[y, 2.8e+55], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.4e+95], N[Not[Or[LessEqual[y, 1.32e+97], And[N[Not[LessEqual[y, 4.6e+123]], $MachinePrecision], LessEqual[y, 2e+145]]]], $MachinePrecision]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot 0.5}{t}\\
t_2 := 0.5 \cdot \frac{x - z}{t}\\
\mathbf{if}\;y \leq 1.7 \cdot 10^{+28}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+55}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+95} \lor \neg \left(y \leq 1.32 \cdot 10^{+97} \lor \neg \left(y \leq 4.6 \cdot 10^{+123}\right) \land y \leq 2 \cdot 10^{+145}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < 1.7e28 or 1.3999999999999999e95 < y < 1.31999999999999994e97 or 4.59999999999999981e123 < y < 2e145Initial program 100.0%
Taylor expanded in y around 0 75.1%
if 1.7e28 < y < 1.3e55 or 2.8000000000000001e55 < y < 1.3999999999999999e95 or 1.31999999999999994e97 < y < 4.59999999999999981e123 or 2e145 < y Initial program 99.9%
Taylor expanded in y around inf 75.1%
associate-*r/75.1%
Simplified75.1%
if 1.3e55 < y < 2.8000000000000001e55Initial program 100.0%
Taylor expanded in x around inf 38.4%
Final simplification75.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.55e+178) (not (<= z 1.42e+57))) (* 0.5 (/ (- x z) t)) (* (+ x y) (/ 0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e+178) || !(z <= 1.42e+57)) {
tmp = 0.5 * ((x - z) / t);
} else {
tmp = (x + 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 ((z <= (-1.55d+178)) .or. (.not. (z <= 1.42d+57))) then
tmp = 0.5d0 * ((x - z) / t)
else
tmp = (x + 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 ((z <= -1.55e+178) || !(z <= 1.42e+57)) {
tmp = 0.5 * ((x - z) / t);
} else {
tmp = (x + y) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.55e+178) or not (z <= 1.42e+57): tmp = 0.5 * ((x - z) / t) else: tmp = (x + y) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.55e+178) || !(z <= 1.42e+57)) tmp = Float64(0.5 * Float64(Float64(x - z) / t)); else tmp = Float64(Float64(x + y) * Float64(0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.55e+178) || ~((z <= 1.42e+57))) tmp = 0.5 * ((x - z) / t); else tmp = (x + y) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.55e+178], N[Not[LessEqual[z, 1.42e+57]], $MachinePrecision]], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+178} \lor \neg \left(z \leq 1.42 \cdot 10^{+57}\right):\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if z < -1.54999999999999996e178 or 1.42e57 < z Initial program 100.0%
Taylor expanded in y around 0 83.7%
if -1.54999999999999996e178 < z < 1.42e57Initial program 100.0%
Taylor expanded in z around 0 89.4%
associate-*r/89.4%
associate-*l/89.1%
*-commutative89.1%
+-commutative89.1%
Simplified89.1%
Final simplification87.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.4e+55) (not (<= x 8.5e+67))) (* 0.5 (/ x t)) (* z (/ -0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.4e+55) || !(x <= 8.5e+67)) {
tmp = 0.5 * (x / 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 <= (-4.4d+55)) .or. (.not. (x <= 8.5d+67))) then
tmp = 0.5d0 * (x / 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 <= -4.4e+55) || !(x <= 8.5e+67)) {
tmp = 0.5 * (x / t);
} else {
tmp = z * (-0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.4e+55) or not (x <= 8.5e+67): tmp = 0.5 * (x / t) else: tmp = z * (-0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.4e+55) || !(x <= 8.5e+67)) tmp = Float64(0.5 * Float64(x / 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 <= -4.4e+55) || ~((x <= 8.5e+67))) tmp = 0.5 * (x / t); else tmp = z * (-0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.4e+55], N[Not[LessEqual[x, 8.5e+67]], $MachinePrecision]], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+55} \lor \neg \left(x \leq 8.5 \cdot 10^{+67}\right):\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\end{array}
\end{array}
if x < -4.40000000000000021e55 or 8.50000000000000038e67 < x Initial program 99.9%
Taylor expanded in x around inf 69.2%
if -4.40000000000000021e55 < x < 8.50000000000000038e67Initial program 100.0%
Taylor expanded in z around inf 42.0%
*-commutative42.0%
associate-*l/42.0%
associate-*r/41.9%
Simplified41.9%
Final simplification53.4%
(FPCore (x y z t) :precision binary64 (if (<= x -5.8e+68) (* 0.5 (/ x t)) (if (<= x -2.45e-79) (/ (* z -0.5) t) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.8e+68) {
tmp = 0.5 * (x / t);
} else if (x <= -2.45e-79) {
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 <= (-5.8d+68)) then
tmp = 0.5d0 * (x / t)
else if (x <= (-2.45d-79)) 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 <= -5.8e+68) {
tmp = 0.5 * (x / t);
} else if (x <= -2.45e-79) {
tmp = (z * -0.5) / t;
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.8e+68: tmp = 0.5 * (x / t) elif x <= -2.45e-79: tmp = (z * -0.5) / t else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.8e+68) tmp = Float64(0.5 * Float64(x / t)); elseif (x <= -2.45e-79) 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 <= -5.8e+68) tmp = 0.5 * (x / t); elseif (x <= -2.45e-79) tmp = (z * -0.5) / t; else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.8e+68], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.45e-79], 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 -5.8 \cdot 10^{+68}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq -2.45 \cdot 10^{-79}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if x < -5.80000000000000023e68Initial program 100.0%
Taylor expanded in x around inf 68.8%
if -5.80000000000000023e68 < x < -2.45e-79Initial program 100.0%
Taylor expanded in z around inf 47.4%
*-commutative47.4%
associate-*l/47.4%
Simplified47.4%
if -2.45e-79 < x Initial program 100.0%
Taylor expanded in y around inf 46.3%
associate-*r/46.3%
Simplified46.3%
Final simplification51.1%
(FPCore (x y z t) :precision binary64 (if (<= x -4.3e+52) (* 0.5 (/ x t)) (if (<= x -1.35e-70) (* z (/ -0.5 t)) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.3e+52) {
tmp = 0.5 * (x / t);
} else if (x <= -1.35e-70) {
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 <= (-4.3d+52)) then
tmp = 0.5d0 * (x / t)
else if (x <= (-1.35d-70)) 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 <= -4.3e+52) {
tmp = 0.5 * (x / t);
} else if (x <= -1.35e-70) {
tmp = z * (-0.5 / t);
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.3e+52: tmp = 0.5 * (x / t) elif x <= -1.35e-70: tmp = z * (-0.5 / t) else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.3e+52) tmp = Float64(0.5 * Float64(x / t)); elseif (x <= -1.35e-70) 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 <= -4.3e+52) tmp = 0.5 * (x / t); elseif (x <= -1.35e-70) tmp = z * (-0.5 / t); else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.3e+52], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.35e-70], 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 \leq -4.3 \cdot 10^{+52}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-70}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if x < -4.3e52Initial program 100.0%
Taylor expanded in x around inf 68.7%
if -4.3e52 < x < -1.3500000000000001e-70Initial program 100.0%
Taylor expanded in z around inf 49.9%
*-commutative49.9%
associate-*l/49.9%
associate-*r/49.9%
Simplified49.9%
if -1.3500000000000001e-70 < x Initial program 100.0%
Taylor expanded in y around inf 46.1%
associate-*r/46.1%
Simplified46.1%
Final simplification51.4%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -1e-84) (* 0.5 (/ (- x z) t)) (* (- y z) (/ 0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= -1e-84) {
tmp = 0.5 * ((x - z) / 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 + y) <= (-1d-84)) then
tmp = 0.5d0 * ((x - z) / 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 + y) <= -1e-84) {
tmp = 0.5 * ((x - z) / t);
} else {
tmp = (y - z) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= -1e-84: tmp = 0.5 * ((x - z) / t) else: tmp = (y - z) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= -1e-84) tmp = Float64(0.5 * Float64(Float64(x - z) / 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 + y) <= -1e-84) tmp = 0.5 * ((x - z) / t); else tmp = (y - z) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -1e-84], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{-84}:\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if (+.f64 x y) < -1e-84Initial program 100.0%
Taylor expanded in y around 0 65.2%
if -1e-84 < (+.f64 x y) Initial program 100.0%
Taylor expanded in x around 0 65.7%
*-commutative65.7%
associate-*l/65.7%
associate-*r/65.6%
Simplified65.6%
(FPCore (x y z t) :precision binary64 (* 0.5 (/ x t)))
double code(double x, double y, double z, double t) {
return 0.5 * (x / 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 = 0.5d0 * (x / t)
end function
public static double code(double x, double y, double z, double t) {
return 0.5 * (x / t);
}
def code(x, y, z, t): return 0.5 * (x / t)
function code(x, y, z, t) return Float64(0.5 * Float64(x / t)) end
function tmp = code(x, y, z, t) tmp = 0.5 * (x / t); end
code[x_, y_, z_, t_] := N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \frac{x}{t}
\end{array}
Initial program 100.0%
Taylor expanded in x around inf 38.4%
herbie shell --seed 2024107
(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)))