
(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 -7e+45) (not (<= z 8.2e+130))) (/ (* z -0.5) t) (* 0.5 (/ (+ x y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7e+45) || !(z <= 8.2e+130)) {
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 <= (-7d+45)) .or. (.not. (z <= 8.2d+130))) 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 <= -7e+45) || !(z <= 8.2e+130)) {
tmp = (z * -0.5) / t;
} else {
tmp = 0.5 * ((x + y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7e+45) or not (z <= 8.2e+130): 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 <= -7e+45) || !(z <= 8.2e+130)) 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 <= -7e+45) || ~((z <= 8.2e+130))) 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, -7e+45], N[Not[LessEqual[z, 8.2e+130]], $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 \cdot 10^{+45} \lor \neg \left(z \leq 8.2 \cdot 10^{+130}\right):\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\
\end{array}
\end{array}
if z < -7.00000000000000046e45 or 8.19999999999999955e130 < z Initial program 99.9%
Taylor expanded in z around inf 73.1%
*-commutative73.1%
associate-*l/73.1%
Simplified73.1%
if -7.00000000000000046e45 < z < 8.19999999999999955e130Initial program 100.0%
Taylor expanded in z around 0 89.1%
+-commutative89.1%
Simplified89.1%
Final simplification83.8%
(FPCore (x y z t) :precision binary64 (if (<= x -1e+118) (* 0.5 (/ (- x z) t)) (if (<= x -7.5e-44) (* 0.5 (/ (+ x y) t)) (* (- y z) (/ 0.5 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e+118) {
tmp = 0.5 * ((x - z) / t);
} else if (x <= -7.5e-44) {
tmp = 0.5 * ((x + y) / 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 <= (-1d+118)) then
tmp = 0.5d0 * ((x - z) / t)
else if (x <= (-7.5d-44)) then
tmp = 0.5d0 * ((x + y) / 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 <= -1e+118) {
tmp = 0.5 * ((x - z) / t);
} else if (x <= -7.5e-44) {
tmp = 0.5 * ((x + y) / t);
} else {
tmp = (y - z) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1e+118: tmp = 0.5 * ((x - z) / t) elif x <= -7.5e-44: tmp = 0.5 * ((x + y) / t) else: tmp = (y - z) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1e+118) tmp = Float64(0.5 * Float64(Float64(x - z) / t)); elseif (x <= -7.5e-44) tmp = Float64(0.5 * Float64(Float64(x + y) / 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 <= -1e+118) tmp = 0.5 * ((x - z) / t); elseif (x <= -7.5e-44) tmp = 0.5 * ((x + y) / t); else tmp = (y - z) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1e+118], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.5e-44], N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+118}:\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-44}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -9.99999999999999967e117Initial program 100.0%
Taylor expanded in y around 0 95.1%
if -9.99999999999999967e117 < x < -7.50000000000000008e-44Initial program 99.9%
Taylor expanded in z around 0 93.7%
+-commutative93.7%
Simplified93.7%
if -7.50000000000000008e-44 < x Initial program 100.0%
Taylor expanded in x around 0 75.3%
*-commutative75.3%
associate-*l/75.3%
associate-*r/75.1%
Simplified75.1%
Final simplification80.9%
(FPCore (x y z t) :precision binary64 (if (<= x -1.05e+118) (* 0.5 (/ (- x z) t)) (if (<= x -4e-44) (* 0.5 (/ (+ x y) t)) (/ (* 0.5 (- y z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.05e+118) {
tmp = 0.5 * ((x - z) / t);
} else if (x <= -4e-44) {
tmp = 0.5 * ((x + y) / 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 (x <= (-1.05d+118)) then
tmp = 0.5d0 * ((x - z) / t)
else if (x <= (-4d-44)) then
tmp = 0.5d0 * ((x + y) / 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 (x <= -1.05e+118) {
tmp = 0.5 * ((x - z) / t);
} else if (x <= -4e-44) {
tmp = 0.5 * ((x + y) / t);
} else {
tmp = (0.5 * (y - z)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.05e+118: tmp = 0.5 * ((x - z) / t) elif x <= -4e-44: tmp = 0.5 * ((x + y) / t) else: tmp = (0.5 * (y - z)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.05e+118) tmp = Float64(0.5 * Float64(Float64(x - z) / t)); elseif (x <= -4e-44) tmp = Float64(0.5 * Float64(Float64(x + y) / 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 (x <= -1.05e+118) tmp = 0.5 * ((x - z) / t); elseif (x <= -4e-44) tmp = 0.5 * ((x + y) / t); else tmp = (0.5 * (y - z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.05e+118], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4e-44], N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+118}:\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\
\mathbf{elif}\;x \leq -4 \cdot 10^{-44}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot \left(y - z\right)}{t}\\
\end{array}
\end{array}
if x < -1.05e118Initial program 100.0%
Taylor expanded in y around 0 95.1%
if -1.05e118 < x < -3.99999999999999981e-44Initial program 99.9%
Taylor expanded in z around 0 93.7%
+-commutative93.7%
Simplified93.7%
if -3.99999999999999981e-44 < x Initial program 100.0%
Taylor expanded in x around 0 75.3%
associate-*r/75.3%
Simplified75.3%
Final simplification81.1%
(FPCore (x y z t) :precision binary64 (if (<= y -3.25e-295) (* 0.5 (/ x t)) (if (<= y 2900000000.0) (* z (/ -0.5 t)) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.25e-295) {
tmp = 0.5 * (x / t);
} else if (y <= 2900000000.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 (y <= (-3.25d-295)) then
tmp = 0.5d0 * (x / t)
else if (y <= 2900000000.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 (y <= -3.25e-295) {
tmp = 0.5 * (x / t);
} else if (y <= 2900000000.0) {
tmp = z * (-0.5 / t);
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.25e-295: tmp = 0.5 * (x / t) elif y <= 2900000000.0: tmp = z * (-0.5 / t) else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.25e-295) tmp = Float64(0.5 * Float64(x / t)); elseif (y <= 2900000000.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 (y <= -3.25e-295) tmp = 0.5 * (x / t); elseif (y <= 2900000000.0) tmp = z * (-0.5 / t); else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.25e-295], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2900000000.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}\;y \leq -3.25 \cdot 10^{-295}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;y \leq 2900000000:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if y < -3.2499999999999999e-295Initial program 99.9%
Taylor expanded in x around inf 42.0%
if -3.2499999999999999e-295 < y < 2.9e9Initial program 100.0%
Taylor expanded in z around inf 47.3%
*-commutative47.3%
associate-*l/47.3%
associate-*r/47.2%
Simplified47.2%
if 2.9e9 < y Initial program 100.0%
Taylor expanded in y around inf 69.9%
associate-*r/69.9%
Simplified69.9%
Final simplification50.8%
(FPCore (x y z t) :precision binary64 (if (<= y -5.1e-294) (* 0.5 (/ x t)) (if (<= y 180000000.0) (/ (* z -0.5) t) (/ (* y 0.5) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.1e-294) {
tmp = 0.5 * (x / t);
} else if (y <= 180000000.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 (y <= (-5.1d-294)) then
tmp = 0.5d0 * (x / t)
else if (y <= 180000000.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 (y <= -5.1e-294) {
tmp = 0.5 * (x / t);
} else if (y <= 180000000.0) {
tmp = (z * -0.5) / t;
} else {
tmp = (y * 0.5) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.1e-294: tmp = 0.5 * (x / t) elif y <= 180000000.0: tmp = (z * -0.5) / t else: tmp = (y * 0.5) / t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.1e-294) tmp = Float64(0.5 * Float64(x / t)); elseif (y <= 180000000.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 (y <= -5.1e-294) tmp = 0.5 * (x / t); elseif (y <= 180000000.0) tmp = (z * -0.5) / t; else tmp = (y * 0.5) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.1e-294], N[(0.5 * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 180000000.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}\;y \leq -5.1 \cdot 10^{-294}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;y \leq 180000000:\\
\;\;\;\;\frac{z \cdot -0.5}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot 0.5}{t}\\
\end{array}
\end{array}
if y < -5.10000000000000007e-294Initial program 99.9%
Taylor expanded in x around inf 42.0%
if -5.10000000000000007e-294 < y < 1.8e8Initial program 100.0%
Taylor expanded in z around inf 47.3%
*-commutative47.3%
associate-*l/47.3%
Simplified47.3%
if 1.8e8 < y Initial program 100.0%
Taylor expanded in y around inf 69.9%
associate-*r/69.9%
Simplified69.9%
Final simplification50.9%
(FPCore (x y z t) :precision binary64 (if (<= y 2200.0) (* 0.5 (/ (- x z) t)) (* 0.5 (/ (+ x y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2200.0) {
tmp = 0.5 * ((x - z) / 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 (y <= 2200.0d0) then
tmp = 0.5d0 * ((x - z) / 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 (y <= 2200.0) {
tmp = 0.5 * ((x - z) / t);
} else {
tmp = 0.5 * ((x + y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2200.0: tmp = 0.5 * ((x - z) / t) else: tmp = 0.5 * ((x + y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2200.0) tmp = Float64(0.5 * Float64(Float64(x - z) / 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 (y <= 2200.0) tmp = 0.5 * ((x - z) / t); else tmp = 0.5 * ((x + y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2200.0], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2200:\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{x + y}{t}\\
\end{array}
\end{array}
if y < 2200Initial program 100.0%
Taylor expanded in y around 0 81.1%
if 2200 < y Initial program 100.0%
Taylor expanded in z around 0 85.8%
+-commutative85.8%
Simplified85.8%
Final simplification82.3%
(FPCore (x y z t) :precision binary64 (if (<= x -4e-44) (* 0.5 (/ x t)) (* z (/ -0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4e-44) {
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 <= (-4d-44)) 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 <= -4e-44) {
tmp = 0.5 * (x / t);
} else {
tmp = z * (-0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4e-44: tmp = 0.5 * (x / t) else: tmp = z * (-0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4e-44) 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 <= -4e-44) tmp = 0.5 * (x / t); else tmp = z * (-0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4e-44], 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 \cdot 10^{-44}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-0.5}{t}\\
\end{array}
\end{array}
if x < -3.99999999999999981e-44Initial program 100.0%
Taylor expanded in x around inf 62.6%
if -3.99999999999999981e-44 < x Initial program 100.0%
Taylor expanded in z around inf 43.3%
*-commutative43.3%
associate-*l/43.3%
associate-*r/43.1%
Simplified43.1%
Final simplification49.0%
(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 40.7%
Final simplification40.7%
herbie shell --seed 2024071
(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)))