
(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%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 0.5 (/ t x))) (t_2 (* 0.5 (/ y t))))
(if (<= x -6.8e+166)
t_1
(if (<= x -5.5e+139)
t_2
(if (<= x -2.9e+25) t_1 (if (<= x 3.1e-284) (* (/ z t) -0.5) t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = 0.5 / (t / x);
double t_2 = 0.5 * (y / t);
double tmp;
if (x <= -6.8e+166) {
tmp = t_1;
} else if (x <= -5.5e+139) {
tmp = t_2;
} else if (x <= -2.9e+25) {
tmp = t_1;
} else if (x <= 3.1e-284) {
tmp = (z / t) * -0.5;
} 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 = 0.5d0 / (t / x)
t_2 = 0.5d0 * (y / t)
if (x <= (-6.8d+166)) then
tmp = t_1
else if (x <= (-5.5d+139)) then
tmp = t_2
else if (x <= (-2.9d+25)) then
tmp = t_1
else if (x <= 3.1d-284) then
tmp = (z / t) * (-0.5d0)
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 = 0.5 / (t / x);
double t_2 = 0.5 * (y / t);
double tmp;
if (x <= -6.8e+166) {
tmp = t_1;
} else if (x <= -5.5e+139) {
tmp = t_2;
} else if (x <= -2.9e+25) {
tmp = t_1;
} else if (x <= 3.1e-284) {
tmp = (z / t) * -0.5;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = 0.5 / (t / x) t_2 = 0.5 * (y / t) tmp = 0 if x <= -6.8e+166: tmp = t_1 elif x <= -5.5e+139: tmp = t_2 elif x <= -2.9e+25: tmp = t_1 elif x <= 3.1e-284: tmp = (z / t) * -0.5 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(0.5 / Float64(t / x)) t_2 = Float64(0.5 * Float64(y / t)) tmp = 0.0 if (x <= -6.8e+166) tmp = t_1; elseif (x <= -5.5e+139) tmp = t_2; elseif (x <= -2.9e+25) tmp = t_1; elseif (x <= 3.1e-284) tmp = Float64(Float64(z / t) * -0.5); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 0.5 / (t / x); t_2 = 0.5 * (y / t); tmp = 0.0; if (x <= -6.8e+166) tmp = t_1; elseif (x <= -5.5e+139) tmp = t_2; elseif (x <= -2.9e+25) tmp = t_1; elseif (x <= 3.1e-284) tmp = (z / t) * -0.5; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 / N[(t / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.8e+166], t$95$1, If[LessEqual[x, -5.5e+139], t$95$2, If[LessEqual[x, -2.9e+25], t$95$1, If[LessEqual[x, 3.1e-284], N[(N[(z / t), $MachinePrecision] * -0.5), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{0.5}{\frac{t}{x}}\\
t_2 := 0.5 \cdot \frac{y}{t}\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{+166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{+139}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-284}:\\
\;\;\;\;\frac{z}{t} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -6.8000000000000001e166 or -5.4999999999999996e139 < x < -2.8999999999999999e25Initial program 100.0%
Taylor expanded in x around inf 75.0%
associate-*r/75.0%
associate-/l*75.0%
Simplified75.0%
if -6.8000000000000001e166 < x < -5.4999999999999996e139 or 3.0999999999999998e-284 < x Initial program 100.0%
Taylor expanded in y around inf 44.7%
if -2.8999999999999999e25 < x < 3.0999999999999998e-284Initial program 100.0%
Taylor expanded in z around inf 55.7%
*-commutative55.7%
Simplified55.7%
Final simplification54.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x 0.5) t)) (t_2 (* 0.5 (/ y t))))
(if (<= x -6.8e+166)
t_1
(if (<= x -5.5e+132)
t_2
(if (<= x -2.3e+25) t_1 (if (<= x 1.55e-284) (* (/ z t) -0.5) t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * 0.5) / t;
double t_2 = 0.5 * (y / t);
double tmp;
if (x <= -6.8e+166) {
tmp = t_1;
} else if (x <= -5.5e+132) {
tmp = t_2;
} else if (x <= -2.3e+25) {
tmp = t_1;
} else if (x <= 1.55e-284) {
tmp = (z / t) * -0.5;
} 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 = (x * 0.5d0) / t
t_2 = 0.5d0 * (y / t)
if (x <= (-6.8d+166)) then
tmp = t_1
else if (x <= (-5.5d+132)) then
tmp = t_2
else if (x <= (-2.3d+25)) then
tmp = t_1
else if (x <= 1.55d-284) then
tmp = (z / t) * (-0.5d0)
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 = (x * 0.5) / t;
double t_2 = 0.5 * (y / t);
double tmp;
if (x <= -6.8e+166) {
tmp = t_1;
} else if (x <= -5.5e+132) {
tmp = t_2;
} else if (x <= -2.3e+25) {
tmp = t_1;
} else if (x <= 1.55e-284) {
tmp = (z / t) * -0.5;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * 0.5) / t t_2 = 0.5 * (y / t) tmp = 0 if x <= -6.8e+166: tmp = t_1 elif x <= -5.5e+132: tmp = t_2 elif x <= -2.3e+25: tmp = t_1 elif x <= 1.55e-284: tmp = (z / t) * -0.5 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * 0.5) / t) t_2 = Float64(0.5 * Float64(y / t)) tmp = 0.0 if (x <= -6.8e+166) tmp = t_1; elseif (x <= -5.5e+132) tmp = t_2; elseif (x <= -2.3e+25) tmp = t_1; elseif (x <= 1.55e-284) tmp = Float64(Float64(z / t) * -0.5); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * 0.5) / t; t_2 = 0.5 * (y / t); tmp = 0.0; if (x <= -6.8e+166) tmp = t_1; elseif (x <= -5.5e+132) tmp = t_2; elseif (x <= -2.3e+25) tmp = t_1; elseif (x <= 1.55e-284) tmp = (z / t) * -0.5; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * 0.5), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.8e+166], t$95$1, If[LessEqual[x, -5.5e+132], t$95$2, If[LessEqual[x, -2.3e+25], t$95$1, If[LessEqual[x, 1.55e-284], N[(N[(z / t), $MachinePrecision] * -0.5), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot 0.5}{t}\\
t_2 := 0.5 \cdot \frac{y}{t}\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{+166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{+132}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-284}:\\
\;\;\;\;\frac{z}{t} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -6.8000000000000001e166 or -5.5e132 < x < -2.2999999999999998e25Initial program 100.0%
Taylor expanded in x around inf 75.0%
associate-*r/75.0%
Simplified75.0%
if -6.8000000000000001e166 < x < -5.5e132 or 1.5499999999999999e-284 < x Initial program 100.0%
Taylor expanded in y around inf 44.7%
if -2.2999999999999998e25 < x < 1.5499999999999999e-284Initial program 100.0%
Taylor expanded in z around inf 55.7%
*-commutative55.7%
Simplified55.7%
Final simplification54.9%
(FPCore (x y z t) :precision binary64 (if (<= x -2.7e+14) (/ 0.5 (/ t (+ x y))) (if (<= x -1.25e-46) (* 0.5 (/ (- x z) t)) (* 0.5 (/ (- y z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.7e+14) {
tmp = 0.5 / (t / (x + y));
} else if (x <= -1.25e-46) {
tmp = 0.5 * ((x - z) / 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 <= (-2.7d+14)) then
tmp = 0.5d0 / (t / (x + y))
else if (x <= (-1.25d-46)) then
tmp = 0.5d0 * ((x - z) / 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 <= -2.7e+14) {
tmp = 0.5 / (t / (x + y));
} else if (x <= -1.25e-46) {
tmp = 0.5 * ((x - z) / t);
} else {
tmp = 0.5 * ((y - z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.7e+14: tmp = 0.5 / (t / (x + y)) elif x <= -1.25e-46: tmp = 0.5 * ((x - z) / t) else: tmp = 0.5 * ((y - z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.7e+14) tmp = Float64(0.5 / Float64(t / Float64(x + y))); elseif (x <= -1.25e-46) tmp = Float64(0.5 * Float64(Float64(x - z) / t)); else tmp = Float64(0.5 * Float64(Float64(y - z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.7e+14) tmp = 0.5 / (t / (x + y)); elseif (x <= -1.25e-46) tmp = 0.5 * ((x - z) / t); else tmp = 0.5 * ((y - z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.7e+14], N[(0.5 / N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.25e-46], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+14}:\\
\;\;\;\;\frac{0.5}{\frac{t}{x + y}}\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-46}:\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if x < -2.7e14Initial program 100.0%
Taylor expanded in z around 0 94.4%
associate-*r/94.4%
+-commutative94.4%
associate-/l*94.3%
+-commutative94.3%
Simplified94.3%
if -2.7e14 < x < -1.24999999999999998e-46Initial program 100.0%
Taylor expanded in y around 0 93.0%
if -1.24999999999999998e-46 < x Initial program 100.0%
Taylor expanded in x around 0 79.7%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.5e+64) (not (<= z 4.6e+88))) (* (/ z t) -0.5) (* 0.5 (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.5e+64) || !(z <= 4.6e+88)) {
tmp = (z / t) * -0.5;
} else {
tmp = 0.5 * (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 <= (-6.5d+64)) .or. (.not. (z <= 4.6d+88))) then
tmp = (z / t) * (-0.5d0)
else
tmp = 0.5d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.5e+64) || !(z <= 4.6e+88)) {
tmp = (z / t) * -0.5;
} else {
tmp = 0.5 * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.5e+64) or not (z <= 4.6e+88): tmp = (z / t) * -0.5 else: tmp = 0.5 * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.5e+64) || !(z <= 4.6e+88)) tmp = Float64(Float64(z / t) * -0.5); else tmp = Float64(0.5 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6.5e+64) || ~((z <= 4.6e+88))) tmp = (z / t) * -0.5; else tmp = 0.5 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.5e+64], N[Not[LessEqual[z, 4.6e+88]], $MachinePrecision]], N[(N[(z / t), $MachinePrecision] * -0.5), $MachinePrecision], N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+64} \lor \neg \left(z \leq 4.6 \cdot 10^{+88}\right):\\
\;\;\;\;\frac{z}{t} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -6.50000000000000007e64 or 4.6000000000000003e88 < z Initial program 100.0%
Taylor expanded in z around inf 77.1%
*-commutative77.1%
Simplified77.1%
if -6.50000000000000007e64 < z < 4.6000000000000003e88Initial program 100.0%
Taylor expanded in y around inf 50.3%
Final simplification58.9%
(FPCore (x y z t) :precision binary64 (if (<= y 1.75e+20) (* 0.5 (/ (- x z) t)) (* 0.5 (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.75e+20) {
tmp = 0.5 * ((x - z) / t);
} else {
tmp = 0.5 * (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 <= 1.75d+20) then
tmp = 0.5d0 * ((x - z) / t)
else
tmp = 0.5d0 * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.75e+20) {
tmp = 0.5 * ((x - z) / t);
} else {
tmp = 0.5 * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.75e+20: tmp = 0.5 * ((x - z) / t) else: tmp = 0.5 * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.75e+20) tmp = Float64(0.5 * Float64(Float64(x - z) / t)); else tmp = Float64(0.5 * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.75e+20) tmp = 0.5 * ((x - z) / t); else tmp = 0.5 * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.75e+20], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.75 \cdot 10^{+20}:\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < 1.75e20Initial program 100.0%
Taylor expanded in y around 0 75.9%
if 1.75e20 < y Initial program 100.0%
Taylor expanded in y around inf 74.2%
Final simplification75.5%
(FPCore (x y z t) :precision binary64 (if (<= x -1.1e-45) (* 0.5 (/ (- x z) t)) (* 0.5 (/ (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.1e-45) {
tmp = 0.5 * ((x - z) / 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.1d-45)) then
tmp = 0.5d0 * ((x - z) / 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.1e-45) {
tmp = 0.5 * ((x - z) / t);
} else {
tmp = 0.5 * ((y - z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.1e-45: tmp = 0.5 * ((x - z) / t) else: tmp = 0.5 * ((y - z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.1e-45) tmp = Float64(0.5 * Float64(Float64(x - z) / t)); else tmp = Float64(0.5 * Float64(Float64(y - z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.1e-45) tmp = 0.5 * ((x - z) / t); else tmp = 0.5 * ((y - z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.1e-45], N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-45}:\\
\;\;\;\;0.5 \cdot \frac{x - z}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y - z}{t}\\
\end{array}
\end{array}
if x < -1.09999999999999997e-45Initial program 100.0%
Taylor expanded in y around 0 75.5%
if -1.09999999999999997e-45 < x Initial program 100.0%
Taylor expanded in x around 0 79.7%
Final simplification78.4%
(FPCore (x y z t) :precision binary64 (* 0.5 (/ y t)))
double code(double x, double y, double z, double t) {
return 0.5 * (y / 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 * (y / t)
end function
public static double code(double x, double y, double z, double t) {
return 0.5 * (y / t);
}
def code(x, y, z, t): return 0.5 * (y / t)
function code(x, y, z, t) return Float64(0.5 * Float64(y / t)) end
function tmp = code(x, y, z, t) tmp = 0.5 * (y / t); end
code[x_, y_, z_, t_] := N[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \frac{y}{t}
\end{array}
Initial program 100.0%
Taylor expanded in y around inf 40.2%
Final simplification40.2%
herbie shell --seed 2023268
(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)))