
(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 11 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(x + Float64(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[(x + N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \left(y - z\right)}{t \cdot 2}
\end{array}
Initial program 100.0%
associate--l+100.0%
Simplified100.0%
(FPCore (x y z t) :precision binary64 (if (<= x -5.8e+148) (/ (+ x y) (* t 2.0)) (if (<= x -2e-36) (/ (- x z) (* t 2.0)) (* (- y z) (/ 0.5 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.8e+148) {
tmp = (x + y) / (t * 2.0);
} else if (x <= -2e-36) {
tmp = (x - z) / (t * 2.0);
} 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 <= (-5.8d+148)) then
tmp = (x + y) / (t * 2.0d0)
else if (x <= (-2d-36)) then
tmp = (x - z) / (t * 2.0d0)
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 <= -5.8e+148) {
tmp = (x + y) / (t * 2.0);
} else if (x <= -2e-36) {
tmp = (x - z) / (t * 2.0);
} else {
tmp = (y - z) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.8e+148: tmp = (x + y) / (t * 2.0) elif x <= -2e-36: tmp = (x - z) / (t * 2.0) else: tmp = (y - z) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.8e+148) tmp = Float64(Float64(x + y) / Float64(t * 2.0)); elseif (x <= -2e-36) tmp = Float64(Float64(x - z) / Float64(t * 2.0)); 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 <= -5.8e+148) tmp = (x + y) / (t * 2.0); elseif (x <= -2e-36) tmp = (x - z) / (t * 2.0); else tmp = (y - z) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.8e+148], N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-36], N[(N[(x - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+148}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-36}:\\
\;\;\;\;\frac{x - z}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -5.7999999999999999e148Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around 0 97.3%
associate-*r/97.3%
*-commutative97.3%
metadata-eval97.3%
associate-/l*97.3%
*-rgt-identity97.3%
rem-square-sqrt18.9%
associate-/l*18.9%
associate-*l/18.9%
*-commutative18.9%
associate-*l/18.9%
associate-*r/18.9%
associate-/r*18.9%
associate-*r/18.9%
rem-square-sqrt97.3%
+-commutative97.3%
Simplified97.3%
if -5.7999999999999999e148 < x < -1.9999999999999999e-36Initial program 100.0%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around 0 79.3%
if -1.9999999999999999e-36 < x Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around 0 80.7%
*-commutative80.7%
associate-*l/80.7%
associate-*r/80.5%
Simplified80.5%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= x -5.8e+148) (/ (+ x y) (* t 2.0)) (if (<= x -2.1e-36) (* (/ 0.5 t) (- x z)) (* (- y z) (/ 0.5 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.8e+148) {
tmp = (x + y) / (t * 2.0);
} else if (x <= -2.1e-36) {
tmp = (0.5 / t) * (x - z);
} 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 <= (-5.8d+148)) then
tmp = (x + y) / (t * 2.0d0)
else if (x <= (-2.1d-36)) then
tmp = (0.5d0 / t) * (x - z)
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 <= -5.8e+148) {
tmp = (x + y) / (t * 2.0);
} else if (x <= -2.1e-36) {
tmp = (0.5 / t) * (x - z);
} else {
tmp = (y - z) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.8e+148: tmp = (x + y) / (t * 2.0) elif x <= -2.1e-36: tmp = (0.5 / t) * (x - z) else: tmp = (y - z) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.8e+148) tmp = Float64(Float64(x + y) / Float64(t * 2.0)); elseif (x <= -2.1e-36) tmp = Float64(Float64(0.5 / t) * Float64(x - z)); 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 <= -5.8e+148) tmp = (x + y) / (t * 2.0); elseif (x <= -2.1e-36) tmp = (0.5 / t) * (x - z); else tmp = (y - z) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.8e+148], N[(N[(x + y), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.1e-36], N[(N[(0.5 / t), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+148}:\\
\;\;\;\;\frac{x + y}{t \cdot 2}\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-36}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -5.7999999999999999e148Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around 0 97.3%
associate-*r/97.3%
*-commutative97.3%
metadata-eval97.3%
associate-/l*97.3%
*-rgt-identity97.3%
rem-square-sqrt18.9%
associate-/l*18.9%
associate-*l/18.9%
*-commutative18.9%
associate-*l/18.9%
associate-*r/18.9%
associate-/r*18.9%
associate-*r/18.9%
rem-square-sqrt97.3%
+-commutative97.3%
Simplified97.3%
if -5.7999999999999999e148 < x < -2.09999999999999991e-36Initial program 100.0%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around 0 79.3%
clear-num79.1%
associate-/r/79.0%
*-commutative79.0%
associate-/r*79.0%
metadata-eval79.0%
Applied egg-rr79.0%
if -2.09999999999999991e-36 < x Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around 0 80.7%
*-commutative80.7%
associate-*l/80.7%
associate-*r/80.5%
Simplified80.5%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= x -6e+146) (* (/ 0.5 t) (+ x y)) (if (<= x -2.1e-36) (* (/ 0.5 t) (- x z)) (* (- y z) (/ 0.5 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6e+146) {
tmp = (0.5 / t) * (x + y);
} else if (x <= -2.1e-36) {
tmp = (0.5 / t) * (x - z);
} 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 <= (-6d+146)) then
tmp = (0.5d0 / t) * (x + y)
else if (x <= (-2.1d-36)) then
tmp = (0.5d0 / t) * (x - z)
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 <= -6e+146) {
tmp = (0.5 / t) * (x + y);
} else if (x <= -2.1e-36) {
tmp = (0.5 / t) * (x - z);
} else {
tmp = (y - z) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6e+146: tmp = (0.5 / t) * (x + y) elif x <= -2.1e-36: tmp = (0.5 / t) * (x - z) else: tmp = (y - z) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6e+146) tmp = Float64(Float64(0.5 / t) * Float64(x + y)); elseif (x <= -2.1e-36) tmp = Float64(Float64(0.5 / t) * Float64(x - z)); 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 <= -6e+146) tmp = (0.5 / t) * (x + y); elseif (x <= -2.1e-36) tmp = (0.5 / t) * (x - z); else tmp = (y - z) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6e+146], N[(N[(0.5 / t), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.1e-36], N[(N[(0.5 / t), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+146}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(x + y\right)\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-36}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(x - z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -6.00000000000000005e146Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around 0 97.3%
associate-*r/97.3%
associate-*l/97.2%
+-commutative97.2%
Simplified97.2%
if -6.00000000000000005e146 < x < -2.09999999999999991e-36Initial program 100.0%
associate--l+99.9%
Simplified99.9%
Taylor expanded in y around 0 79.3%
clear-num79.1%
associate-/r/79.0%
*-commutative79.0%
associate-/r*79.0%
metadata-eval79.0%
Applied egg-rr79.0%
if -2.09999999999999991e-36 < x Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around 0 80.7%
*-commutative80.7%
associate-*l/80.7%
associate-*r/80.5%
Simplified80.5%
Final simplification82.7%
(FPCore (x y z t) :precision binary64 (if (<= x -4.4e+53) (/ x (* t 2.0)) (if (<= x -8.5e-243) (* (/ z t) -0.5) (/ y (* t 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.4e+53) {
tmp = x / (t * 2.0);
} else if (x <= -8.5e-243) {
tmp = (z / t) * -0.5;
} 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 <= (-4.4d+53)) then
tmp = x / (t * 2.0d0)
else if (x <= (-8.5d-243)) then
tmp = (z / t) * (-0.5d0)
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 <= -4.4e+53) {
tmp = x / (t * 2.0);
} else if (x <= -8.5e-243) {
tmp = (z / t) * -0.5;
} else {
tmp = y / (t * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.4e+53: tmp = x / (t * 2.0) elif x <= -8.5e-243: tmp = (z / t) * -0.5 else: tmp = y / (t * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.4e+53) tmp = Float64(x / Float64(t * 2.0)); elseif (x <= -8.5e-243) tmp = Float64(Float64(z / t) * -0.5); 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 <= -4.4e+53) tmp = x / (t * 2.0); elseif (x <= -8.5e-243) tmp = (z / t) * -0.5; else tmp = y / (t * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.4e+53], N[(x / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-243], N[(N[(z / t), $MachinePrecision] * -0.5), $MachinePrecision], N[(y / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+53}:\\
\;\;\;\;\frac{x}{t \cdot 2}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-243}:\\
\;\;\;\;\frac{z}{t} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t \cdot 2}\\
\end{array}
\end{array}
if x < -4.39999999999999997e53Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around inf 70.5%
if -4.39999999999999997e53 < x < -8.5000000000000002e-243Initial program 99.9%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around inf 53.6%
*-commutative53.6%
Simplified53.6%
if -8.5000000000000002e-243 < x Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in y around inf 47.4%
(FPCore (x y z t) :precision binary64 (if (<= x -5.7e+53) (/ x (* t 2.0)) (if (<= x -4.3e-243) (* (/ z t) -0.5) (* y (/ 0.5 t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.7e+53) {
tmp = x / (t * 2.0);
} else if (x <= -4.3e-243) {
tmp = (z / t) * -0.5;
} 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.7d+53)) then
tmp = x / (t * 2.0d0)
else if (x <= (-4.3d-243)) then
tmp = (z / t) * (-0.5d0)
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.7e+53) {
tmp = x / (t * 2.0);
} else if (x <= -4.3e-243) {
tmp = (z / t) * -0.5;
} else {
tmp = y * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.7e+53: tmp = x / (t * 2.0) elif x <= -4.3e-243: tmp = (z / t) * -0.5 else: tmp = y * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.7e+53) tmp = Float64(x / Float64(t * 2.0)); elseif (x <= -4.3e-243) tmp = Float64(Float64(z / t) * -0.5); else tmp = Float64(y * Float64(0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.7e+53) tmp = x / (t * 2.0); elseif (x <= -4.3e-243) tmp = (z / t) * -0.5; else tmp = y * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.7e+53], N[(x / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.3e-243], N[(N[(z / t), $MachinePrecision] * -0.5), $MachinePrecision], N[(y * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.7 \cdot 10^{+53}:\\
\;\;\;\;\frac{x}{t \cdot 2}\\
\mathbf{elif}\;x \leq -4.3 \cdot 10^{-243}:\\
\;\;\;\;\frac{z}{t} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -5.70000000000000017e53Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around inf 70.5%
if -5.70000000000000017e53 < x < -4.3e-243Initial program 99.9%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around inf 53.6%
*-commutative53.6%
Simplified53.6%
if -4.3e-243 < x Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around 0 71.6%
associate-*r/71.6%
associate-*l/71.4%
+-commutative71.4%
Simplified71.4%
Taylor expanded in y around inf 47.3%
Final simplification54.7%
(FPCore (x y z t) :precision binary64 (if (<= x -3.4e+53) (* (/ 0.5 t) (+ x y)) (* (- y z) (/ 0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.4e+53) {
tmp = (0.5 / t) * (x + y);
} 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 <= (-3.4d+53)) then
tmp = (0.5d0 / t) * (x + y)
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 <= -3.4e+53) {
tmp = (0.5 / t) * (x + y);
} else {
tmp = (y - z) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.4e+53: tmp = (0.5 / t) * (x + y) else: tmp = (y - z) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.4e+53) tmp = Float64(Float64(0.5 / t) * Float64(x + y)); 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 <= -3.4e+53) tmp = (0.5 / t) * (x + y); else tmp = (y - z) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.4e+53], N[(N[(0.5 / t), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+53}:\\
\;\;\;\;\frac{0.5}{t} \cdot \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -3.39999999999999998e53Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around 0 86.7%
associate-*r/86.7%
associate-*l/86.5%
+-commutative86.5%
Simplified86.5%
if -3.39999999999999998e53 < x Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around 0 80.8%
*-commutative80.8%
associate-*l/80.8%
associate-*r/80.5%
Simplified80.5%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (<= x -6.5e+60) (/ x (* t 2.0)) (* (- y z) (/ 0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.5e+60) {
tmp = x / (t * 2.0);
} 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 <= (-6.5d+60)) then
tmp = x / (t * 2.0d0)
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 <= -6.5e+60) {
tmp = x / (t * 2.0);
} else {
tmp = (y - z) * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.5e+60: tmp = x / (t * 2.0) else: tmp = (y - z) * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.5e+60) tmp = Float64(x / Float64(t * 2.0)); 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 <= -6.5e+60) tmp = x / (t * 2.0); else tmp = (y - z) * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.5e+60], N[(x / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{+60}:\\
\;\;\;\;\frac{x}{t \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if x < -6.49999999999999931e60Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around inf 71.6%
if -6.49999999999999931e60 < x Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in x around 0 80.9%
*-commutative80.9%
associate-*l/80.9%
associate-*r/80.6%
Simplified80.6%
(FPCore (x y z t) :precision binary64 (if (<= y 6.2e+56) (* (/ z t) -0.5) (* y (/ 0.5 t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.2e+56) {
tmp = (z / t) * -0.5;
} 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 <= 6.2d+56) then
tmp = (z / t) * (-0.5d0)
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 <= 6.2e+56) {
tmp = (z / t) * -0.5;
} else {
tmp = y * (0.5 / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 6.2e+56: tmp = (z / t) * -0.5 else: tmp = y * (0.5 / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 6.2e+56) tmp = Float64(Float64(z / t) * -0.5); else tmp = Float64(y * Float64(0.5 / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 6.2e+56) tmp = (z / t) * -0.5; else tmp = y * (0.5 / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 6.2e+56], N[(N[(z / t), $MachinePrecision] * -0.5), $MachinePrecision], N[(y * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+56}:\\
\;\;\;\;\frac{z}{t} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{0.5}{t}\\
\end{array}
\end{array}
if y < 6.20000000000000009e56Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around inf 44.6%
*-commutative44.6%
Simplified44.6%
if 6.20000000000000009e56 < y Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around 0 82.8%
associate-*r/82.8%
associate-*l/82.6%
+-commutative82.6%
Simplified82.6%
Taylor expanded in y around inf 73.4%
Final simplification52.2%
(FPCore (x y z t) :precision binary64 (* (+ x (- y z)) (/ 0.5 t)))
double code(double x, double y, double z, double t) {
return (x + (y - z)) * (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 + (y - z)) * (0.5d0 / t)
end function
public static double code(double x, double y, double z, double t) {
return (x + (y - z)) * (0.5 / t);
}
def code(x, y, z, t): return (x + (y - z)) * (0.5 / t)
function code(x, y, z, t) return Float64(Float64(x + Float64(y - z)) * Float64(0.5 / t)) end
function tmp = code(x, y, z, t) tmp = (x + (y - z)) * (0.5 / t); end
code[x_, y_, z_, t_] := N[(N[(x + N[(y - z), $MachinePrecision]), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \left(y - z\right)\right) \cdot \frac{0.5}{t}
\end{array}
Initial program 100.0%
associate--l+100.0%
Simplified100.0%
clear-num99.4%
associate-/r/99.7%
*-commutative99.7%
associate-/r*99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (* y (/ 0.5 t)))
double code(double x, double y, double z, double t) {
return y * (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 = y * (0.5d0 / t)
end function
public static double code(double x, double y, double z, double t) {
return y * (0.5 / t);
}
def code(x, y, z, t): return y * (0.5 / t)
function code(x, y, z, t) return Float64(y * Float64(0.5 / t)) end
function tmp = code(x, y, z, t) tmp = y * (0.5 / t); end
code[x_, y_, z_, t_] := N[(y * N[(0.5 / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{0.5}{t}
\end{array}
Initial program 100.0%
associate--l+100.0%
Simplified100.0%
Taylor expanded in z around 0 71.2%
associate-*r/71.2%
associate-*l/71.0%
+-commutative71.0%
Simplified71.0%
Taylor expanded in y around inf 39.7%
Final simplification39.7%
herbie shell --seed 2024157
(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)))