
(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 10 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 (or (<= z -1.12e+160) (not (<= z 1.15e+77))) (/ (* z -0.5) t) (* (+ x y) (/ 0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.12e+160) || !(z <= 1.15e+77)) {
tmp = (z * -0.5) / 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.12d+160)) .or. (.not. (z <= 1.15d+77))) then
tmp = (z * (-0.5d0)) / 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.12e+160) || !(z <= 1.15e+77)) {
tmp = (z * -0.5) / t;
} else {
tmp = (x + y) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.12e+160) or not (z <= 1.15e+77): tmp = (z * -0.5) / t else: tmp = (x + y) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.12e+160) || !(z <= 1.15e+77)) tmp = Float64(Float64(z * -0.5) / 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.12e+160) || ~((z <= 1.15e+77))) tmp = (z * -0.5) / t; else tmp = (x + y) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.12e+160], N[Not[LessEqual[z, 1.15e+77]], $MachinePrecision]], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(N[(x + y), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{+160} \lor \neg \left(z \leq 1.15 \cdot 10^{+77}\right):\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if z < -1.12e160 or 1.14999999999999997e77 < z Initial program 100.0%
Taylor expanded in z around inf 76.7%
associate-*r/76.7%
Simplified76.7%
if -1.12e160 < z < 1.14999999999999997e77Initial program 100.0%
Taylor expanded in x around 0 96.6%
associate-*r/96.6%
associate-*l/96.6%
associate-*r/96.6%
associate-*l/96.4%
distribute-lft-in99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 90.8%
Final simplification86.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.48e+84) (not (<= z 2.1e+67))) (* z (/ -0.5 t)) (* 0.5 (/ x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.48e+84) || !(z <= 2.1e+67)) {
tmp = z * (-0.5 / t);
} else {
tmp = 0.5 * (x / 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.48d+84)) .or. (.not. (z <= 2.1d+67))) then
tmp = z * ((-0.5d0) / t)
else
tmp = 0.5d0 * (x / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.48e+84) || !(z <= 2.1e+67)) {
tmp = z * (-0.5 / t);
} else {
tmp = 0.5 * (x / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.48e+84) or not (z <= 2.1e+67): tmp = z * (-0.5 / t) else: tmp = 0.5 * (x / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.48e+84) || !(z <= 2.1e+67)) tmp = Float64(z * Float64(-0.5 / t)); else tmp = Float64(0.5 * Float64(x / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.48e+84) || ~((z <= 2.1e+67))) tmp = z * (-0.5 / t); else tmp = 0.5 * (x / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.48e+84], N[Not[LessEqual[z, 2.1e+67]], $MachinePrecision]], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.48 \cdot 10^{+84} \lor \neg \left(z \leq 2.1 \cdot 10^{+67}\right):\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if z < -1.4800000000000001e84 or 2.1000000000000001e67 < z Initial program 100.0%
Taylor expanded in z around inf 69.7%
associate-*r/69.7%
Simplified69.7%
*-commutative69.7%
associate-/l*69.4%
Applied egg-rr69.4%
if -1.4800000000000001e84 < z < 2.1000000000000001e67Initial program 100.0%
Taylor expanded in x around inf 49.1%
Final simplification56.7%
(FPCore (x y z t) :precision binary64 (if (<= y 3.2e-216) (* 0.5 (/ x t)) (if (<= y 9.5e+68) (/ (* z -0.5) t) (/ y (* t 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.2e-216) {
tmp = 0.5 * (x / t);
} else if (y <= 9.5e+68) {
tmp = (z * -0.5) / t;
} else {
tmp = y / (t * 2.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 3.2d-216) then
tmp = 0.5d0 * (x / t)
else if (y <= 9.5d+68) then
tmp = (z * (-0.5d0)) / t
else
tmp = y / (t * 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.2e-216) {
tmp = 0.5 * (x / t);
} else if (y <= 9.5e+68) {
tmp = (z * -0.5) / t;
} else {
tmp = y / (t * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.2e-216: tmp = 0.5 * (x / t) elif y <= 9.5e+68: tmp = (z * -0.5) / t else: tmp = y / (t * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.2e-216) tmp = Float64(0.5 * Float64(x / t)); elseif (y <= 9.5e+68) tmp = Float64(Float64(z * -0.5) / t); else tmp = Float64(y / Float64(t * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.2e-216) tmp = 0.5 * (x / t); elseif (y <= 9.5e+68) tmp = (z * -0.5) / t; else tmp = y / (t * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.2e-216], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+68], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(y / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{-216}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+68}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t \cdot 2}\\
\end{array}
\end{array}
if y < 3.20000000000000026e-216Initial program 100.0%
Taylor expanded in x around inf 47.0%
if 3.20000000000000026e-216 < y < 9.50000000000000069e68Initial program 100.0%
Taylor expanded in z around inf 52.6%
associate-*r/52.6%
Simplified52.6%
if 9.50000000000000069e68 < y Initial program 100.0%
Taylor expanded in y around inf 77.0%
Final simplification55.3%
(FPCore (x y z t) :precision binary64 (if (<= y 2.15e-215) (* 0.5 (/ x t)) (if (<= y 2.3e+68) (* z (/ -0.5 t)) (/ y (* t 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.15e-215) {
tmp = 0.5 * (x / t);
} else if (y <= 2.3e+68) {
tmp = z * (-0.5 / t);
} else {
tmp = y / (t * 2.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.15d-215) then
tmp = 0.5d0 * (x / t)
else if (y <= 2.3d+68) then
tmp = z * ((-0.5d0) / t)
else
tmp = y / (t * 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.15e-215) {
tmp = 0.5 * (x / t);
} else if (y <= 2.3e+68) {
tmp = z * (-0.5 / t);
} else {
tmp = y / (t * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.15e-215: tmp = 0.5 * (x / t) elif y <= 2.3e+68: tmp = z * (-0.5 / t) else: tmp = y / (t * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.15e-215) tmp = Float64(0.5 * Float64(x / t)); elseif (y <= 2.3e+68) tmp = Float64(z * Float64(-0.5 / t)); else tmp = Float64(y / Float64(t * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.15e-215) tmp = 0.5 * (x / t); elseif (y <= 2.3e+68) tmp = z * (-0.5 / t); else tmp = y / (t * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.15e-215], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+68], N[(z * N[(-0.5 / t), $MachinePrecision]), $MachinePrecision], N[(y / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.15 \cdot 10^{-215}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+68}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t \cdot 2}\\
\end{array}
\end{array}
if y < 2.15000000000000012e-215Initial program 100.0%
Taylor expanded in x around inf 47.0%
if 2.15000000000000012e-215 < y < 2.3e68Initial program 100.0%
Taylor expanded in z around inf 52.6%
associate-*r/52.6%
Simplified52.6%
*-commutative52.6%
associate-/l*52.4%
Applied egg-rr52.4%
if 2.3e68 < y Initial program 100.0%
Taylor expanded in y around inf 77.0%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) -5e-176) (/ (- 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) <= -5e-176) {
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) <= (-5d-176)) 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) <= -5e-176) {
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) <= -5e-176: 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) <= -5e-176) 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) <= -5e-176) 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], -5e-176], 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 -5 \cdot 10^{-176}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - z}{t \cdot 2}\\
\end{array}
\end{array}
if (+.f64 x y) < -5e-176Initial program 99.9%
Taylor expanded in y around 0 72.9%
if -5e-176 < (+.f64 x y) Initial program 100.0%
Taylor expanded in x around 0 73.4%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) 5e+67) (/ (- x z) (* t 2.0)) (/ y (* t 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= 5e+67) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = y / (t * 2.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x + y) <= 5d+67) then
tmp = (x - z) / (t * 2.0d0)
else
tmp = y / (t * 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= 5e+67) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = y / (t * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= 5e+67: tmp = (x - z) / (t * 2.0) else: tmp = y / (t * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= 5e+67) tmp = Float64(Float64(x - z) / Float64(t * 2.0)); else tmp = Float64(y / Float64(t * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= 5e+67) tmp = (x - z) / (t * 2.0); else tmp = y / (t * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], 5e+67], N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(y / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 5 \cdot 10^{+67}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t \cdot 2}\\
\end{array}
\end{array}
if (+.f64 x y) < 4.99999999999999976e67Initial program 100.0%
Taylor expanded in y around 0 74.2%
if 4.99999999999999976e67 < (+.f64 x y) Initial program 100.0%
Taylor expanded in y around inf 51.6%
(FPCore (x y z t) :precision binary64 (if (<= (+ x y) 5e+67) (* (/ 0.5 t) (- x z)) (/ y (* t 2.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= 5e+67) {
tmp = (0.5 / t) * (x - z);
} else {
tmp = y / (t * 2.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x + y) <= 5d+67) then
tmp = (0.5d0 / t) * (x - z)
else
tmp = y / (t * 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x + y) <= 5e+67) {
tmp = (0.5 / t) * (x - z);
} else {
tmp = y / (t * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x + y) <= 5e+67: tmp = (0.5 / t) * (x - z) else: tmp = y / (t * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x + y) <= 5e+67) tmp = Float64(Float64(0.5 / t) * Float64(x - z)); else tmp = Float64(y / Float64(t * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x + y) <= 5e+67) tmp = (0.5 / t) * (x - z); else tmp = y / (t * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], 5e+67], N[(N[(0.5 / t), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision], N[(y / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 5 \cdot 10^{+67}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t \cdot 2}\\
\end{array}
\end{array}
if (+.f64 x y) < 4.99999999999999976e67Initial program 100.0%
Taylor expanded in x around 0 96.3%
associate-*r/96.3%
associate-*l/96.2%
associate-*r/96.2%
associate-*l/96.0%
distribute-lft-in99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 74.0%
if 4.99999999999999976e67 < (+.f64 x y) Initial program 100.0%
Taylor expanded in y around inf 51.6%
(FPCore (x y z t) :precision binary64 (* (/ 0.5 t) (+ x (- y z))))
double code(double x, double y, double z, double t) {
return (0.5 / t) * (x + (y - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (0.5d0 / t) * (x + (y - z))
end function
public static double code(double x, double y, double z, double t) {
return (0.5 / t) * (x + (y - z));
}
def code(x, y, z, t): return (0.5 / t) * (x + (y - z))
function code(x, y, z, t) return Float64(Float64(0.5 / t) * Float64(x + Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = (0.5 / t) * (x + (y - z)); end
code[x_, y_, z_, t_] := N[(N[(0.5 / t), $MachinePrecision] * N[(x + N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{0.5}{t} \cdot \left(x + \left(y - z\right)\right)
\end{array}
Initial program 100.0%
Taylor expanded in x around 0 95.7%
associate-*r/95.7%
associate-*l/95.6%
associate-*r/95.6%
associate-*l/95.4%
distribute-lft-in99.7%
+-commutative99.7%
Simplified99.7%
Final simplification99.7%
(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.2%
herbie shell --seed 2024140
(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)))