
(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%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.2e+71) (not (<= z 1.85e+41))) (/ (* z -0.5) t) (* 0.5 (/ (+ x y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e+71) || !(z <= 1.85e+41)) {
tmp = (z * -0.5) / t;
} else {
tmp = 0.5 * ((x + y) / 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 <= (-7.2d+71)) .or. (.not. (z <= 1.85d+41))) then
tmp = (z * (-0.5d0)) / t
else
tmp = 0.5d0 * ((x + y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e+71) || !(z <= 1.85e+41)) {
tmp = (z * -0.5) / t;
} else {
tmp = 0.5 * ((x + y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.2e+71) or not (z <= 1.85e+41): tmp = (z * -0.5) / t else: tmp = 0.5 * ((x + y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.2e+71) || !(z <= 1.85e+41)) tmp = Float64(Float64(z * -0.5) / t); else tmp = Float64(0.5 * Float64(Float64(x + y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.2e+71) || ~((z <= 1.85e+41))) tmp = (z * -0.5) / t; else tmp = 0.5 * ((x + y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.2e+71], N[Not[LessEqual[z, 1.85e+41]], $MachinePrecision]], N[(N[(z * -0.5), $MachinePrecision] / t), $MachinePrecision], N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+71} \lor \neg \left(z \leq 1.85 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\
\end{array}
\end{array}
if z < -7.1999999999999999e71 or 1.84999999999999991e41 < z Initial program 100.0%
Taylor expanded in z around inf 75.8%
*-commutative75.8%
associate-*l/75.8%
Simplified75.8%
if -7.1999999999999999e71 < z < 1.84999999999999991e41Initial program 99.9%
Taylor expanded in z around 0 89.6%
+-commutative89.6%
Simplified89.6%
Final simplification83.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.9e+71) (not (<= z 4.9e+33))) (* (- x z) (/ 0.5 t)) (* 0.5 (/ (+ x y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+71) || !(z <= 4.9e+33)) {
tmp = (x - z) * (0.5 / t);
} else {
tmp = 0.5 * ((x + y) / 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 <= (-2.9d+71)) .or. (.not. (z <= 4.9d+33))) then
tmp = (x - z) * (0.5d0 / t)
else
tmp = 0.5d0 * ((x + y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.9e+71) || !(z <= 4.9e+33)) {
tmp = (x - z) * (0.5 / t);
} else {
tmp = 0.5 * ((x + y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.9e+71) or not (z <= 4.9e+33): tmp = (x - z) * (0.5 / t) else: tmp = 0.5 * ((x + y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.9e+71) || !(z <= 4.9e+33)) tmp = Float64(Float64(x - z) * Float64(0.5 / t)); else tmp = Float64(0.5 * Float64(Float64(x + y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.9e+71) || ~((z <= 4.9e+33))) tmp = (x - z) * (0.5 / t); else tmp = 0.5 * ((x + y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.9e+71], N[Not[LessEqual[z, 4.9e+33]], $MachinePrecision]], N[(N[(x - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+71} \lor \neg \left(z \leq 4.9 \cdot 10^{+33}\right):\\
\;\;\;\;\left(x - z\right) \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\
\end{array}
\end{array}
if z < -2.90000000000000007e71 or 4.90000000000000014e33 < z Initial program 100.0%
Taylor expanded in y around 0 90.1%
*-commutative90.1%
associate-*l/90.1%
associate-/l*89.9%
Simplified89.9%
if -2.90000000000000007e71 < z < 4.90000000000000014e33Initial program 99.9%
Taylor expanded in z around 0 89.5%
+-commutative89.5%
Simplified89.5%
Final simplification89.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2e+34) (not (<= z 2.5e+38))) (* z (/ -0.5 t)) (* 0.5 (/ x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2e+34) || !(z <= 2.5e+38)) {
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 <= (-2d+34)) .or. (.not. (z <= 2.5d+38))) 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 <= -2e+34) || !(z <= 2.5e+38)) {
tmp = z * (-0.5 / t);
} else {
tmp = 0.5 * (x / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2e+34) or not (z <= 2.5e+38): tmp = z * (-0.5 / t) else: tmp = 0.5 * (x / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2e+34) || !(z <= 2.5e+38)) 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 <= -2e+34) || ~((z <= 2.5e+38))) 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, -2e+34], N[Not[LessEqual[z, 2.5e+38]], $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 -2 \cdot 10^{+34} \lor \neg \left(z \leq 2.5 \cdot 10^{+38}\right):\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\end{array}
\end{array}
if z < -1.99999999999999989e34 or 2.49999999999999985e38 < z Initial program 100.0%
Taylor expanded in z around inf 73.1%
*-commutative73.1%
associate-*l/73.1%
associate-*r/73.0%
Simplified73.0%
if -1.99999999999999989e34 < z < 2.49999999999999985e38Initial program 99.9%
Taylor expanded in x around inf 50.0%
Final simplification60.1%
(FPCore (x y z t) :precision binary64 (if (<= x -2.8e-12) (* 0.5 (/ x t)) (if (<= x -1.85e-220) (* z (/ -0.5 t)) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.8e-12) {
tmp = 0.5 * (x / t);
} else if (x <= -1.85e-220) {
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 <= (-2.8d-12)) then
tmp = 0.5d0 * (x / t)
else if (x <= (-1.85d-220)) 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 <= -2.8e-12) {
tmp = 0.5 * (x / t);
} else if (x <= -1.85e-220) {
tmp = z * (-0.5 / t);
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.8e-12: tmp = 0.5 * (x / t) elif x <= -1.85e-220: tmp = z * (-0.5 / t) else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.8e-12) tmp = Float64(0.5 * Float64(x / t)); elseif (x <= -1.85e-220) 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 <= -2.8e-12) tmp = 0.5 * (x / t); elseif (x <= -1.85e-220) tmp = z * (-0.5 / t); else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.8e-12], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.85e-220], 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 -2.8 \cdot 10^{-12}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-220}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if x < -2.8000000000000002e-12Initial program 100.0%
Taylor expanded in x around inf 60.5%
if -2.8000000000000002e-12 < x < -1.85000000000000007e-220Initial program 99.9%
Taylor expanded in z around inf 61.4%
*-commutative61.4%
associate-*l/61.4%
associate-*r/61.2%
Simplified61.2%
if -1.85000000000000007e-220 < x Initial program 100.0%
Taylor expanded in y around inf 44.3%
associate-*r/44.3%
Simplified44.3%
Final simplification51.8%
(FPCore (x y z t) :precision binary64 (if (<= x -4.3e-12) (* 0.5 (/ x t)) (if (<= x -8.5e-238) (/ (* z -0.5) t) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.3e-12) {
tmp = 0.5 * (x / t);
} else if (x <= -8.5e-238) {
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-12)) then
tmp = 0.5d0 * (x / t)
else if (x <= (-8.5d-238)) 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-12) {
tmp = 0.5 * (x / t);
} else if (x <= -8.5e-238) {
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-12: tmp = 0.5 * (x / t) elif x <= -8.5e-238: 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-12) tmp = Float64(0.5 * Float64(x / t)); elseif (x <= -8.5e-238) 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 <= -4.3e-12) tmp = 0.5 * (x / t); elseif (x <= -8.5e-238) 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-12], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-238], 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 -4.3 \cdot 10^{-12}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-238}:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if x < -4.29999999999999985e-12Initial program 100.0%
Taylor expanded in x around inf 60.5%
if -4.29999999999999985e-12 < x < -8.5000000000000006e-238Initial program 99.9%
Taylor expanded in z around inf 61.8%
*-commutative61.8%
associate-*l/61.8%
Simplified61.8%
if -8.5000000000000006e-238 < x Initial program 100.0%
Taylor expanded in y around inf 43.8%
associate-*r/43.8%
Simplified43.8%
Final simplification51.8%
(FPCore (x y z t) :precision binary64 (if (<= y 1.55e-73) (* (- x z) (/ 0.5 t)) (* (/ 0.5 t) (- y z))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.55e-73) {
tmp = (x - z) * (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 (y <= 1.55d-73) then
tmp = (x - z) * (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 (y <= 1.55e-73) {
tmp = (x - z) * (0.5 / t);
} else {
tmp = (0.5 / t) * (y - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.55e-73: tmp = (x - z) * (0.5 / t) else: tmp = (0.5 / t) * (y - z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.55e-73) tmp = Float64(Float64(x - z) * Float64(0.5 / t)); else tmp = Float64(Float64(0.5 / t) * Float64(y - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.55e-73) tmp = (x - z) * (0.5 / t); else tmp = (0.5 / t) * (y - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.55e-73], N[(N[(x - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.55 \cdot 10^{-73}:\\
\;\;\;\;\left(x - z\right) \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(y - z\right)\\
\end{array}
\end{array}
if y < 1.54999999999999985e-73Initial program 100.0%
Taylor expanded in y around 0 79.3%
*-commutative79.3%
associate-*l/79.3%
associate-/l*79.1%
Simplified79.1%
if 1.54999999999999985e-73 < y Initial program 100.0%
Taylor expanded in x around 0 87.7%
*-commutative87.7%
associate-*l/87.7%
associate-*r/87.4%
Simplified87.4%
Final simplification81.7%
(FPCore (x y z t) :precision binary64 (if (<= y 1.25e-73) (* (- x z) (/ 0.5 t)) (/ (* 0.5 (- y z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.25e-73) {
tmp = (x - z) * (0.5 / t);
} else {
tmp = (0.5 * (y - z)) / 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 <= 1.25d-73) then
tmp = (x - z) * (0.5d0 / t)
else
tmp = (0.5d0 * (y - z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.25e-73) {
tmp = (x - z) * (0.5 / t);
} else {
tmp = (0.5 * (y - z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.25e-73: tmp = (x - z) * (0.5 / t) else: tmp = (0.5 * (y - z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.25e-73) tmp = Float64(Float64(x - z) * Float64(0.5 / t)); else tmp = Float64(Float64(0.5 * Float64(y - z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.25e-73) tmp = (x - z) * (0.5 / t); else tmp = (0.5 * (y - z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.25e-73], N[(N[(x - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{-73}:\\
\;\;\;\;\left(x - z\right) \cdot \frac{0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(y - z\right)}{t}\\
\end{array}
\end{array}
if y < 1.25e-73Initial program 100.0%
Taylor expanded in y around 0 79.3%
*-commutative79.3%
associate-*l/79.3%
associate-/l*79.1%
Simplified79.1%
if 1.25e-73 < y Initial program 100.0%
Taylor expanded in x around 0 87.7%
associate-*r/87.7%
Simplified87.7%
Final simplification81.8%
(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 37.7%
Final simplification37.7%
herbie shell --seed 2024059
(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)))