
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - 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 = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - 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 = x + ((y * (z - x)) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (* (/ y t) (- z x))))
double code(double x, double y, double z, double t) {
return x + ((y / t) * (z - x));
}
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 / t) * (z - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y / t) * (z - x));
}
def code(x, y, z, t): return x + ((y / t) * (z - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y / t) * Float64(z - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y / t) * (z - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{t} \cdot \left(z - x\right)
\end{array}
Initial program 91.0%
Taylor expanded in z around 0 89.1%
+-commutative89.1%
*-commutative89.1%
associate-*r/88.3%
mul-1-neg88.3%
associate-/l*93.4%
distribute-lft-neg-in93.4%
distribute-rgt-in98.5%
sub-neg98.5%
Simplified98.5%
(FPCore (x y z t) :precision binary64 (if (<= y -1.4e-50) (* x (/ y (- t))) (if (<= y 2.4e-20) x (if (<= y 2.3e+87) (* y (/ z t)) (/ x (/ (- t) y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-50) {
tmp = x * (y / -t);
} else if (y <= 2.4e-20) {
tmp = x;
} else if (y <= 2.3e+87) {
tmp = y * (z / t);
} else {
tmp = x / (-t / y);
}
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.4d-50)) then
tmp = x * (y / -t)
else if (y <= 2.4d-20) then
tmp = x
else if (y <= 2.3d+87) then
tmp = y * (z / t)
else
tmp = x / (-t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.4e-50) {
tmp = x * (y / -t);
} else if (y <= 2.4e-20) {
tmp = x;
} else if (y <= 2.3e+87) {
tmp = y * (z / t);
} else {
tmp = x / (-t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.4e-50: tmp = x * (y / -t) elif y <= 2.4e-20: tmp = x elif y <= 2.3e+87: tmp = y * (z / t) else: tmp = x / (-t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.4e-50) tmp = Float64(x * Float64(y / Float64(-t))); elseif (y <= 2.4e-20) tmp = x; elseif (y <= 2.3e+87) tmp = Float64(y * Float64(z / t)); else tmp = Float64(x / Float64(Float64(-t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.4e-50) tmp = x * (y / -t); elseif (y <= 2.4e-20) tmp = x; elseif (y <= 2.3e+87) tmp = y * (z / t); else tmp = x / (-t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e-50], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.4e-20], x, If[LessEqual[y, 2.3e+87], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x / N[((-t) / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-50}:\\
\;\;\;\;x \cdot \frac{y}{-t}\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-20}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+87}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{-t}{y}}\\
\end{array}
\end{array}
if y < -1.3999999999999999e-50Initial program 84.5%
Taylor expanded in y around -inf 73.7%
Taylor expanded in z around 0 56.0%
mul-1-neg56.0%
associate-/l*57.1%
distribute-rgt-neg-in57.1%
mul-1-neg57.1%
associate-*r/57.1%
mul-1-neg57.1%
Simplified57.1%
if -1.3999999999999999e-50 < y < 2.39999999999999993e-20Initial program 97.5%
Taylor expanded in y around 0 64.3%
if 2.39999999999999993e-20 < y < 2.3000000000000002e87Initial program 93.5%
Taylor expanded in y around -inf 64.3%
Taylor expanded in z around inf 48.2%
associate-/l*80.5%
Simplified50.1%
if 2.3000000000000002e87 < y Initial program 79.4%
Taylor expanded in y around -inf 70.6%
Taylor expanded in z around 0 49.8%
mul-1-neg49.8%
associate-/l*64.9%
distribute-rgt-neg-in64.9%
mul-1-neg64.9%
associate-*r/64.9%
mul-1-neg64.9%
Simplified64.9%
distribute-frac-neg64.9%
distribute-rgt-neg-out64.9%
add-sqr-sqrt64.8%
sqrt-unprod52.7%
sqr-neg52.7%
sqrt-unprod0.0%
add-sqr-sqrt1.2%
clear-num1.2%
un-div-inv1.2%
add-sqr-sqrt0.0%
sqrt-unprod52.7%
sqr-neg52.7%
sqrt-unprod64.7%
add-sqr-sqrt65.0%
Applied egg-rr65.0%
Final simplification60.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (/ (- t) y))))
(if (<= y -1.6e-50)
t_1
(if (<= y 9.8e-23) x (if (<= y 3.65e+90) (* y (/ z t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (-t / y);
double tmp;
if (y <= -1.6e-50) {
tmp = t_1;
} else if (y <= 9.8e-23) {
tmp = x;
} else if (y <= 3.65e+90) {
tmp = y * (z / t);
} else {
tmp = t_1;
}
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) :: tmp
t_1 = x / (-t / y)
if (y <= (-1.6d-50)) then
tmp = t_1
else if (y <= 9.8d-23) then
tmp = x
else if (y <= 3.65d+90) then
tmp = y * (z / t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (-t / y);
double tmp;
if (y <= -1.6e-50) {
tmp = t_1;
} else if (y <= 9.8e-23) {
tmp = x;
} else if (y <= 3.65e+90) {
tmp = y * (z / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (-t / y) tmp = 0 if y <= -1.6e-50: tmp = t_1 elif y <= 9.8e-23: tmp = x elif y <= 3.65e+90: tmp = y * (z / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(Float64(-t) / y)) tmp = 0.0 if (y <= -1.6e-50) tmp = t_1; elseif (y <= 9.8e-23) tmp = x; elseif (y <= 3.65e+90) tmp = Float64(y * Float64(z / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (-t / y); tmp = 0.0; if (y <= -1.6e-50) tmp = t_1; elseif (y <= 9.8e-23) tmp = x; elseif (y <= 3.65e+90) tmp = y * (z / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[((-t) / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.6e-50], t$95$1, If[LessEqual[y, 9.8e-23], x, If[LessEqual[y, 3.65e+90], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{\frac{-t}{y}}\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.65 \cdot 10^{+90}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.6e-50 or 3.64999999999999997e90 < y Initial program 82.9%
Taylor expanded in y around -inf 72.7%
Taylor expanded in z around 0 54.1%
mul-1-neg54.1%
associate-/l*59.5%
distribute-rgt-neg-in59.5%
mul-1-neg59.5%
associate-*r/59.5%
mul-1-neg59.5%
Simplified59.5%
distribute-frac-neg59.5%
distribute-rgt-neg-out59.5%
add-sqr-sqrt19.8%
sqrt-unprod17.9%
sqr-neg17.9%
sqrt-unprod2.0%
add-sqr-sqrt2.4%
clear-num2.4%
un-div-inv2.4%
add-sqr-sqrt2.0%
sqrt-unprod18.0%
sqr-neg18.0%
sqrt-unprod19.7%
add-sqr-sqrt59.5%
Applied egg-rr59.5%
if -1.6e-50 < y < 9.7999999999999996e-23Initial program 97.5%
Taylor expanded in y around 0 64.3%
if 9.7999999999999996e-23 < y < 3.64999999999999997e90Initial program 93.5%
Taylor expanded in y around -inf 64.3%
Taylor expanded in z around inf 48.2%
associate-/l*80.5%
Simplified50.1%
Final simplification60.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.25e+94) (not (<= z 2.8))) (+ x (* (/ y t) z)) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.25e+94) || !(z <= 2.8)) {
tmp = x + ((y / t) * z);
} else {
tmp = x * (1.0 - (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 <= (-3.25d+94)) .or. (.not. (z <= 2.8d0))) then
tmp = x + ((y / t) * z)
else
tmp = x * (1.0d0 - (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.25e+94) || !(z <= 2.8)) {
tmp = x + ((y / t) * z);
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.25e+94) or not (z <= 2.8): tmp = x + ((y / t) * z) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.25e+94) || !(z <= 2.8)) tmp = Float64(x + Float64(Float64(y / t) * z)); else tmp = Float64(x * Float64(1.0 - Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.25e+94) || ~((z <= 2.8))) tmp = x + ((y / t) * z); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.25e+94], N[Not[LessEqual[z, 2.8]], $MachinePrecision]], N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.25 \cdot 10^{+94} \lor \neg \left(z \leq 2.8\right):\\
\;\;\;\;x + \frac{y}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if z < -3.24999999999999988e94 or 2.7999999999999998 < z Initial program 86.9%
Taylor expanded in z around 0 84.9%
+-commutative84.9%
*-commutative84.9%
associate-*r/90.9%
mul-1-neg90.9%
associate-/l*96.4%
distribute-lft-neg-in96.4%
distribute-rgt-in98.3%
sub-neg98.3%
Simplified98.3%
Taylor expanded in z around inf 94.6%
if -3.24999999999999988e94 < z < 2.7999999999999998Initial program 93.8%
Taylor expanded in x around inf 89.7%
mul-1-neg89.7%
unsub-neg89.7%
Simplified89.7%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.9e+93) (not (<= z 1.6e+125))) (* y (/ (- z x) t)) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e+93) || !(z <= 1.6e+125)) {
tmp = y * ((z - x) / t);
} else {
tmp = x * (1.0 - (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 <= (-3.9d+93)) .or. (.not. (z <= 1.6d+125))) then
tmp = y * ((z - x) / t)
else
tmp = x * (1.0d0 - (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.9e+93) || !(z <= 1.6e+125)) {
tmp = y * ((z - x) / t);
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.9e+93) or not (z <= 1.6e+125): tmp = y * ((z - x) / t) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.9e+93) || !(z <= 1.6e+125)) tmp = Float64(y * Float64(Float64(z - x) / t)); else tmp = Float64(x * Float64(1.0 - Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.9e+93) || ~((z <= 1.6e+125))) tmp = y * ((z - x) / t); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.9e+93], N[Not[LessEqual[z, 1.6e+125]], $MachinePrecision]], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+93} \lor \neg \left(z \leq 1.6 \cdot 10^{+125}\right):\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if z < -3.9000000000000002e93 or 1.59999999999999992e125 < z Initial program 85.6%
Taylor expanded in y around -inf 63.6%
associate-/l*66.5%
*-commutative66.5%
Applied egg-rr66.5%
if -3.9000000000000002e93 < z < 1.59999999999999992e125Initial program 93.5%
Taylor expanded in x around inf 86.6%
mul-1-neg86.6%
unsub-neg86.6%
Simplified86.6%
Final simplification80.4%
(FPCore (x y z t) :precision binary64 (if (<= x -4.5e+55) (* x (- 1.0 (/ y t))) (if (<= x 1.9e-14) (+ x (* y (/ z t))) (* x (/ (- t y) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.5e+55) {
tmp = x * (1.0 - (y / t));
} else if (x <= 1.9e-14) {
tmp = x + (y * (z / t));
} else {
tmp = x * ((t - 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 (x <= (-4.5d+55)) then
tmp = x * (1.0d0 - (y / t))
else if (x <= 1.9d-14) then
tmp = x + (y * (z / t))
else
tmp = x * ((t - y) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.5e+55) {
tmp = x * (1.0 - (y / t));
} else if (x <= 1.9e-14) {
tmp = x + (y * (z / t));
} else {
tmp = x * ((t - y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.5e+55: tmp = x * (1.0 - (y / t)) elif x <= 1.9e-14: tmp = x + (y * (z / t)) else: tmp = x * ((t - y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.5e+55) tmp = Float64(x * Float64(1.0 - Float64(y / t))); elseif (x <= 1.9e-14) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(x * Float64(Float64(t - y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.5e+55) tmp = x * (1.0 - (y / t)); elseif (x <= 1.9e-14) tmp = x + (y * (z / t)); else tmp = x * ((t - y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.5e+55], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.9e-14], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(t - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+55}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-14}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t - y}{t}\\
\end{array}
\end{array}
if x < -4.49999999999999998e55Initial program 89.0%
Taylor expanded in x around inf 97.0%
mul-1-neg97.0%
unsub-neg97.0%
Simplified97.0%
if -4.49999999999999998e55 < x < 1.9000000000000001e-14Initial program 91.4%
Taylor expanded in z around inf 81.6%
associate-/l*83.6%
Simplified83.6%
if 1.9000000000000001e-14 < x Initial program 92.5%
Taylor expanded in x around inf 89.4%
mul-1-neg89.4%
unsub-neg89.4%
Simplified89.4%
Taylor expanded in t around 0 89.4%
(FPCore (x y z t) :precision binary64 (if (<= z -1.15e+96) (/ (* y z) t) (if (<= z 2.1e+125) (* x (- 1.0 (/ y t))) (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.15e+96) {
tmp = (y * z) / t;
} else if (z <= 2.1e+125) {
tmp = x * (1.0 - (y / t));
} else {
tmp = 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 (z <= (-1.15d+96)) then
tmp = (y * z) / t
else if (z <= 2.1d+125) then
tmp = x * (1.0d0 - (y / t))
else
tmp = y * (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.15e+96) {
tmp = (y * z) / t;
} else if (z <= 2.1e+125) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.15e+96: tmp = (y * z) / t elif z <= 2.1e+125: tmp = x * (1.0 - (y / t)) else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.15e+96) tmp = Float64(Float64(y * z) / t); elseif (z <= 2.1e+125) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.15e+96) tmp = (y * z) / t; elseif (z <= 2.1e+125) tmp = x * (1.0 - (y / t)); else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.15e+96], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2.1e+125], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+96}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+125}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -1.15000000000000008e96Initial program 89.4%
Taylor expanded in y around -inf 66.4%
Taylor expanded in z around inf 64.3%
if -1.15000000000000008e96 < z < 2.1000000000000001e125Initial program 93.5%
Taylor expanded in x around inf 86.6%
mul-1-neg86.6%
unsub-neg86.6%
Simplified86.6%
if 2.1000000000000001e125 < z Initial program 80.2%
Taylor expanded in y around -inf 59.8%
Taylor expanded in z around inf 59.3%
associate-/l*80.2%
Simplified62.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.3e+112) (not (<= y 1.6e-20))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e+112) || !(y <= 1.6e-20)) {
tmp = y * (z / t);
} else {
tmp = x;
}
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.3d+112)) .or. (.not. (y <= 1.6d-20))) then
tmp = y * (z / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e+112) || !(y <= 1.6e-20)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.3e+112) or not (y <= 1.6e-20): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.3e+112) || !(y <= 1.6e-20)) tmp = Float64(y * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.3e+112) || ~((y <= 1.6e-20))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.3e+112], N[Not[LessEqual[y, 1.6e-20]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+112} \lor \neg \left(y \leq 1.6 \cdot 10^{-20}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.3e112 or 1.59999999999999985e-20 < y Initial program 84.3%
Taylor expanded in y around -inf 71.9%
Taylor expanded in z around inf 41.4%
associate-/l*61.9%
Simplified47.1%
if -1.3e112 < y < 1.59999999999999985e-20Initial program 96.0%
Taylor expanded in y around 0 59.3%
Final simplification54.2%
(FPCore (x y z t) :precision binary64 (if (<= t -2.2e+20) x (if (<= t 6.2e-181) (/ (* y z) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.2e+20) {
tmp = x;
} else if (t <= 6.2e-181) {
tmp = (y * z) / t;
} else {
tmp = x;
}
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 (t <= (-2.2d+20)) then
tmp = x
else if (t <= 6.2d-181) then
tmp = (y * z) / t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.2e+20) {
tmp = x;
} else if (t <= 6.2e-181) {
tmp = (y * z) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.2e+20: tmp = x elif t <= 6.2e-181: tmp = (y * z) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.2e+20) tmp = x; elseif (t <= 6.2e-181) tmp = Float64(Float64(y * z) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.2e+20) tmp = x; elseif (t <= 6.2e-181) tmp = (y * z) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.2e+20], x, If[LessEqual[t, 6.2e-181], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+20}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-181}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.2e20 or 6.20000000000000043e-181 < t Initial program 86.6%
Taylor expanded in y around 0 59.8%
if -2.2e20 < t < 6.20000000000000043e-181Initial program 97.7%
Taylor expanded in y around -inf 84.8%
Taylor expanded in z around inf 49.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1.25e+110) (/ y (/ t z)) (if (<= y 2.25e-22) x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.25e+110) {
tmp = y / (t / z);
} else if (y <= 2.25e-22) {
tmp = x;
} else {
tmp = 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+110)) then
tmp = y / (t / z)
else if (y <= 2.25d-22) then
tmp = x
else
tmp = 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+110) {
tmp = y / (t / z);
} else if (y <= 2.25e-22) {
tmp = x;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.25e+110: tmp = y / (t / z) elif y <= 2.25e-22: tmp = x else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.25e+110) tmp = Float64(y / Float64(t / z)); elseif (y <= 2.25e-22) tmp = x; else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.25e+110) tmp = y / (t / z); elseif (y <= 2.25e-22) tmp = x; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.25e+110], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e-22], x, N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25 \cdot 10^{+110}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{-22}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if y < -1.24999999999999995e110Initial program 81.8%
Taylor expanded in y around -inf 77.6%
Taylor expanded in z around inf 42.8%
associate-/l*61.3%
Simplified54.8%
clear-num54.7%
un-div-inv54.8%
Applied egg-rr54.8%
if -1.24999999999999995e110 < y < 2.24999999999999993e-22Initial program 96.0%
Taylor expanded in y around 0 59.3%
if 2.24999999999999993e-22 < y Initial program 86.2%
Taylor expanded in y around -inf 67.6%
Taylor expanded in z around inf 40.4%
associate-/l*62.4%
Simplified41.4%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 91.0%
Taylor expanded in y around 0 41.4%
(FPCore (x y z t) :precision binary64 (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (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 = x - ((x * (y / t)) + (-z * (y / t)))
end function
public static double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
def code(x, y, z, t): return x - ((x * (y / t)) + (-z * (y / t)))
function code(x, y, z, t) return Float64(x - Float64(Float64(x * Float64(y / t)) + Float64(Float64(-z) * Float64(y / t)))) end
function tmp = code(x, y, z, t) tmp = x - ((x * (y / t)) + (-z * (y / t))); end
code[x_, y_, z_, t_] := N[(x - N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)
\end{array}
herbie shell --seed 2024172
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:alt
(! :herbie-platform default (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
(+ x (/ (* y (- z x)) t)))