
(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 17 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
(let* ((t_1 (+ x (/ (* (- z x) y) t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+308)))
(+ x (* y (/ (- z x) t)))
t_1)))
double code(double x, double y, double z, double t) {
double t_1 = x + (((z - x) * y) / t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+308)) {
tmp = x + (y * ((z - x) / t));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + (((z - x) * y) / t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+308)) {
tmp = x + (y * ((z - x) / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (((z - x) * y) / t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+308): tmp = x + (y * ((z - x) / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(Float64(z - x) * y) / t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+308)) tmp = Float64(x + Float64(y * Float64(Float64(z - x) / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (((z - x) * y) / t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+308))) tmp = x + (y * ((z - x) / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+308]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+308}\right):\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0 or 1e308 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 76.2%
associate-/l*100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 1e308Initial program 99.8%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z y) t)))
(if (<= t -8.1e+30)
x
(if (<= t -9.2e-82)
(* z (/ y t))
(if (<= t -7.2e-264)
(* (- y) (/ x t))
(if (<= t 3.1e-267)
t_1
(if (<= t 2.05e-156)
(* x (/ y (- t)))
(if (<= t 1.4e+32) t_1 x))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * y) / t;
double tmp;
if (t <= -8.1e+30) {
tmp = x;
} else if (t <= -9.2e-82) {
tmp = z * (y / t);
} else if (t <= -7.2e-264) {
tmp = -y * (x / t);
} else if (t <= 3.1e-267) {
tmp = t_1;
} else if (t <= 2.05e-156) {
tmp = x * (y / -t);
} else if (t <= 1.4e+32) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (z * y) / t
if (t <= (-8.1d+30)) then
tmp = x
else if (t <= (-9.2d-82)) then
tmp = z * (y / t)
else if (t <= (-7.2d-264)) then
tmp = -y * (x / t)
else if (t <= 3.1d-267) then
tmp = t_1
else if (t <= 2.05d-156) then
tmp = x * (y / -t)
else if (t <= 1.4d+32) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * y) / t;
double tmp;
if (t <= -8.1e+30) {
tmp = x;
} else if (t <= -9.2e-82) {
tmp = z * (y / t);
} else if (t <= -7.2e-264) {
tmp = -y * (x / t);
} else if (t <= 3.1e-267) {
tmp = t_1;
} else if (t <= 2.05e-156) {
tmp = x * (y / -t);
} else if (t <= 1.4e+32) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * y) / t tmp = 0 if t <= -8.1e+30: tmp = x elif t <= -9.2e-82: tmp = z * (y / t) elif t <= -7.2e-264: tmp = -y * (x / t) elif t <= 3.1e-267: tmp = t_1 elif t <= 2.05e-156: tmp = x * (y / -t) elif t <= 1.4e+32: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * y) / t) tmp = 0.0 if (t <= -8.1e+30) tmp = x; elseif (t <= -9.2e-82) tmp = Float64(z * Float64(y / t)); elseif (t <= -7.2e-264) tmp = Float64(Float64(-y) * Float64(x / t)); elseif (t <= 3.1e-267) tmp = t_1; elseif (t <= 2.05e-156) tmp = Float64(x * Float64(y / Float64(-t))); elseif (t <= 1.4e+32) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * y) / t; tmp = 0.0; if (t <= -8.1e+30) tmp = x; elseif (t <= -9.2e-82) tmp = z * (y / t); elseif (t <= -7.2e-264) tmp = -y * (x / t); elseif (t <= 3.1e-267) tmp = t_1; elseif (t <= 2.05e-156) tmp = x * (y / -t); elseif (t <= 1.4e+32) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -8.1e+30], x, If[LessEqual[t, -9.2e-82], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -7.2e-264], N[((-y) * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e-267], t$95$1, If[LessEqual[t, 2.05e-156], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+32], t$95$1, x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot y}{t}\\
\mathbf{if}\;t \leq -8.1 \cdot 10^{+30}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-82}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq -7.2 \cdot 10^{-264}:\\
\;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{-156}:\\
\;\;\;\;x \cdot \frac{y}{-t}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -8.0999999999999996e30 or 1.4e32 < t Initial program 82.1%
+-commutative82.1%
associate-/l*98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in y around 0 68.1%
if -8.0999999999999996e30 < t < -9.19999999999999988e-82Initial program 99.6%
+-commutative99.6%
associate-/l*85.7%
fma-define85.7%
Simplified85.7%
Taylor expanded in y around -inf 75.8%
Taylor expanded in z around inf 56.2%
associate-/l*46.8%
Simplified46.8%
*-commutative46.8%
associate-*l/56.2%
Applied egg-rr56.2%
associate-*r/56.4%
*-commutative56.4%
Applied egg-rr56.4%
if -9.19999999999999988e-82 < t < -7.2000000000000004e-264Initial program 99.9%
+-commutative99.9%
associate-/l*97.0%
fma-define97.0%
Simplified97.0%
Taylor expanded in y around -inf 88.0%
associate-/l*97.0%
*-commutative97.0%
Applied egg-rr88.1%
Taylor expanded in z around 0 71.9%
neg-mul-171.9%
distribute-neg-frac271.9%
Simplified71.9%
if -7.2000000000000004e-264 < t < 3.1000000000000001e-267 or 2.0500000000000001e-156 < t < 1.4e32Initial program 99.8%
+-commutative99.8%
associate-/l*84.2%
fma-define84.2%
Simplified84.2%
Taylor expanded in y around -inf 76.9%
Taylor expanded in z around inf 57.1%
if 3.1000000000000001e-267 < t < 2.0500000000000001e-156Initial program 99.8%
+-commutative99.8%
associate-/l*89.6%
fma-define89.6%
Simplified89.6%
Taylor expanded in y around -inf 89.5%
Taylor expanded in z around 0 67.5%
mul-1-neg67.5%
associate-/l*68.0%
distribute-rgt-neg-in68.0%
mul-1-neg68.0%
associate-*r/68.0%
mul-1-neg68.0%
Simplified68.0%
Final simplification65.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (/ y t))))
(if (<= t -1.32e+37)
x
(if (<= t -9.2e-82)
t_1
(if (<= t -1.12e-259)
(* (- y) (/ x t))
(if (<= t 4.4e-253)
t_1
(if (<= t 3.7e-155)
(/ x (/ t (- y)))
(if (<= t 4.1e+30) (/ (* z y) t) x))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (y / t);
double tmp;
if (t <= -1.32e+37) {
tmp = x;
} else if (t <= -9.2e-82) {
tmp = t_1;
} else if (t <= -1.12e-259) {
tmp = -y * (x / t);
} else if (t <= 4.4e-253) {
tmp = t_1;
} else if (t <= 3.7e-155) {
tmp = x / (t / -y);
} else if (t <= 4.1e+30) {
tmp = (z * y) / 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) :: t_1
real(8) :: tmp
t_1 = z * (y / t)
if (t <= (-1.32d+37)) then
tmp = x
else if (t <= (-9.2d-82)) then
tmp = t_1
else if (t <= (-1.12d-259)) then
tmp = -y * (x / t)
else if (t <= 4.4d-253) then
tmp = t_1
else if (t <= 3.7d-155) then
tmp = x / (t / -y)
else if (t <= 4.1d+30) then
tmp = (z * y) / t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (y / t);
double tmp;
if (t <= -1.32e+37) {
tmp = x;
} else if (t <= -9.2e-82) {
tmp = t_1;
} else if (t <= -1.12e-259) {
tmp = -y * (x / t);
} else if (t <= 4.4e-253) {
tmp = t_1;
} else if (t <= 3.7e-155) {
tmp = x / (t / -y);
} else if (t <= 4.1e+30) {
tmp = (z * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (y / t) tmp = 0 if t <= -1.32e+37: tmp = x elif t <= -9.2e-82: tmp = t_1 elif t <= -1.12e-259: tmp = -y * (x / t) elif t <= 4.4e-253: tmp = t_1 elif t <= 3.7e-155: tmp = x / (t / -y) elif t <= 4.1e+30: tmp = (z * y) / t else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(y / t)) tmp = 0.0 if (t <= -1.32e+37) tmp = x; elseif (t <= -9.2e-82) tmp = t_1; elseif (t <= -1.12e-259) tmp = Float64(Float64(-y) * Float64(x / t)); elseif (t <= 4.4e-253) tmp = t_1; elseif (t <= 3.7e-155) tmp = Float64(x / Float64(t / Float64(-y))); elseif (t <= 4.1e+30) tmp = Float64(Float64(z * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (y / t); tmp = 0.0; if (t <= -1.32e+37) tmp = x; elseif (t <= -9.2e-82) tmp = t_1; elseif (t <= -1.12e-259) tmp = -y * (x / t); elseif (t <= 4.4e-253) tmp = t_1; elseif (t <= 3.7e-155) tmp = x / (t / -y); elseif (t <= 4.1e+30) tmp = (z * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.32e+37], x, If[LessEqual[t, -9.2e-82], t$95$1, If[LessEqual[t, -1.12e-259], N[((-y) * N[(x / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-253], t$95$1, If[LessEqual[t, 3.7e-155], N[(x / N[(t / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.1e+30], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -1.32 \cdot 10^{+37}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.12 \cdot 10^{-259}:\\
\;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-253}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-155}:\\
\;\;\;\;\frac{x}{\frac{t}{-y}}\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{+30}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.3199999999999999e37 or 4.10000000000000005e30 < t Initial program 82.1%
+-commutative82.1%
associate-/l*98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in y around 0 68.1%
if -1.3199999999999999e37 < t < -9.19999999999999988e-82 or -1.1199999999999999e-259 < t < 4.39999999999999992e-253Initial program 99.7%
+-commutative99.7%
associate-/l*77.7%
fma-define77.7%
Simplified77.7%
Taylor expanded in y around -inf 84.6%
Taylor expanded in z around inf 58.8%
associate-/l*46.5%
Simplified46.5%
*-commutative46.5%
associate-*l/58.8%
Applied egg-rr58.8%
associate-*r/59.0%
*-commutative59.0%
Applied egg-rr59.0%
if -9.19999999999999988e-82 < t < -1.1199999999999999e-259Initial program 99.9%
+-commutative99.9%
associate-/l*97.0%
fma-define97.0%
Simplified97.0%
Taylor expanded in y around -inf 88.0%
associate-/l*97.0%
*-commutative97.0%
Applied egg-rr88.1%
Taylor expanded in z around 0 71.9%
neg-mul-171.9%
distribute-neg-frac271.9%
Simplified71.9%
if 4.39999999999999992e-253 < t < 3.7e-155Initial program 99.9%
+-commutative99.9%
associate-/l*90.9%
fma-define90.9%
Simplified90.9%
Taylor expanded in y around -inf 91.2%
Taylor expanded in z around 0 76.8%
mul-1-neg76.8%
associate-/l*72.7%
distribute-rgt-neg-in72.7%
mul-1-neg72.7%
associate-*r/72.7%
mul-1-neg72.7%
Simplified72.7%
add-sqr-sqrt29.7%
sqrt-unprod30.1%
distribute-frac-neg30.1%
distribute-frac-neg30.1%
sqr-neg30.1%
sqrt-unprod0.4%
add-sqr-sqrt5.5%
clear-num5.5%
div-inv5.5%
frac-2neg5.5%
distribute-frac-neg25.5%
add-sqr-sqrt5.1%
sqrt-unprod43.6%
sqr-neg43.6%
sqrt-unprod42.9%
add-sqr-sqrt72.8%
Applied egg-rr72.8%
if 3.7e-155 < t < 4.10000000000000005e30Initial program 99.8%
+-commutative99.8%
associate-/l*90.1%
fma-define90.1%
Simplified90.1%
Taylor expanded in y around -inf 71.1%
Taylor expanded in z around inf 54.7%
Final simplification65.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- y)) t)) (t_2 (* z (/ y t))))
(if (<= t -1.58e+31)
x
(if (<= t -1.45e-81)
t_2
(if (<= t -2.25e-276)
t_1
(if (<= t 1.2e-251)
t_2
(if (<= t 1.3e-155) t_1 (if (<= t 2.2e+35) (/ (* z y) t) x))))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * -y) / t;
double t_2 = z * (y / t);
double tmp;
if (t <= -1.58e+31) {
tmp = x;
} else if (t <= -1.45e-81) {
tmp = t_2;
} else if (t <= -2.25e-276) {
tmp = t_1;
} else if (t <= 1.2e-251) {
tmp = t_2;
} else if (t <= 1.3e-155) {
tmp = t_1;
} else if (t <= 2.2e+35) {
tmp = (z * y) / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * -y) / t
t_2 = z * (y / t)
if (t <= (-1.58d+31)) then
tmp = x
else if (t <= (-1.45d-81)) then
tmp = t_2
else if (t <= (-2.25d-276)) then
tmp = t_1
else if (t <= 1.2d-251) then
tmp = t_2
else if (t <= 1.3d-155) then
tmp = t_1
else if (t <= 2.2d+35) then
tmp = (z * y) / t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * -y) / t;
double t_2 = z * (y / t);
double tmp;
if (t <= -1.58e+31) {
tmp = x;
} else if (t <= -1.45e-81) {
tmp = t_2;
} else if (t <= -2.25e-276) {
tmp = t_1;
} else if (t <= 1.2e-251) {
tmp = t_2;
} else if (t <= 1.3e-155) {
tmp = t_1;
} else if (t <= 2.2e+35) {
tmp = (z * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * -y) / t t_2 = z * (y / t) tmp = 0 if t <= -1.58e+31: tmp = x elif t <= -1.45e-81: tmp = t_2 elif t <= -2.25e-276: tmp = t_1 elif t <= 1.2e-251: tmp = t_2 elif t <= 1.3e-155: tmp = t_1 elif t <= 2.2e+35: tmp = (z * y) / t else: tmp = x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(-y)) / t) t_2 = Float64(z * Float64(y / t)) tmp = 0.0 if (t <= -1.58e+31) tmp = x; elseif (t <= -1.45e-81) tmp = t_2; elseif (t <= -2.25e-276) tmp = t_1; elseif (t <= 1.2e-251) tmp = t_2; elseif (t <= 1.3e-155) tmp = t_1; elseif (t <= 2.2e+35) tmp = Float64(Float64(z * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * -y) / t; t_2 = z * (y / t); tmp = 0.0; if (t <= -1.58e+31) tmp = x; elseif (t <= -1.45e-81) tmp = t_2; elseif (t <= -2.25e-276) tmp = t_1; elseif (t <= 1.2e-251) tmp = t_2; elseif (t <= 1.3e-155) tmp = t_1; elseif (t <= 2.2e+35) tmp = (z * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * (-y)), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.58e+31], x, If[LessEqual[t, -1.45e-81], t$95$2, If[LessEqual[t, -2.25e-276], t$95$1, If[LessEqual[t, 1.2e-251], t$95$2, If[LessEqual[t, 1.3e-155], t$95$1, If[LessEqual[t, 2.2e+35], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], x]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(-y\right)}{t}\\
t_2 := z \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -1.58 \cdot 10^{+31}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-81}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.25 \cdot 10^{-276}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-251}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+35}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.57999999999999992e31 or 2.1999999999999999e35 < t Initial program 82.1%
+-commutative82.1%
associate-/l*98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in y around 0 68.1%
if -1.57999999999999992e31 < t < -1.44999999999999994e-81 or -2.24999999999999981e-276 < t < 1.19999999999999998e-251Initial program 99.7%
+-commutative99.7%
associate-/l*81.7%
fma-define81.7%
Simplified81.7%
Taylor expanded in y around -inf 83.8%
Taylor expanded in z around inf 59.2%
associate-/l*48.9%
Simplified48.9%
*-commutative48.9%
associate-*l/59.2%
Applied egg-rr59.2%
associate-*r/59.4%
*-commutative59.4%
Applied egg-rr59.4%
if -1.44999999999999994e-81 < t < -2.24999999999999981e-276 or 1.19999999999999998e-251 < t < 1.30000000000000004e-155Initial program 99.9%
+-commutative99.9%
associate-/l*91.4%
fma-define91.4%
Simplified91.4%
Taylor expanded in y around -inf 89.6%
Taylor expanded in z around 0 73.1%
associate-*r/73.1%
mul-1-neg73.1%
distribute-lft-neg-out73.1%
*-commutative73.1%
Simplified73.1%
if 1.30000000000000004e-155 < t < 2.1999999999999999e35Initial program 99.8%
+-commutative99.8%
associate-/l*90.1%
fma-define90.1%
Simplified90.1%
Taylor expanded in y around -inf 71.1%
Taylor expanded in z around inf 54.7%
Final simplification65.4%
(FPCore (x y z t)
:precision binary64
(if (<= t -9.2e+34)
x
(if (<= t -5.4e-82)
(* z (/ y t))
(if (<= t 9.5e-157)
(* x (/ y (- t)))
(if (<= t 4.9e+36) (/ (* z y) t) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9.2e+34) {
tmp = x;
} else if (t <= -5.4e-82) {
tmp = z * (y / t);
} else if (t <= 9.5e-157) {
tmp = x * (y / -t);
} else if (t <= 4.9e+36) {
tmp = (z * y) / 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 <= (-9.2d+34)) then
tmp = x
else if (t <= (-5.4d-82)) then
tmp = z * (y / t)
else if (t <= 9.5d-157) then
tmp = x * (y / -t)
else if (t <= 4.9d+36) then
tmp = (z * y) / 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 <= -9.2e+34) {
tmp = x;
} else if (t <= -5.4e-82) {
tmp = z * (y / t);
} else if (t <= 9.5e-157) {
tmp = x * (y / -t);
} else if (t <= 4.9e+36) {
tmp = (z * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -9.2e+34: tmp = x elif t <= -5.4e-82: tmp = z * (y / t) elif t <= 9.5e-157: tmp = x * (y / -t) elif t <= 4.9e+36: tmp = (z * y) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -9.2e+34) tmp = x; elseif (t <= -5.4e-82) tmp = Float64(z * Float64(y / t)); elseif (t <= 9.5e-157) tmp = Float64(x * Float64(y / Float64(-t))); elseif (t <= 4.9e+36) tmp = Float64(Float64(z * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -9.2e+34) tmp = x; elseif (t <= -5.4e-82) tmp = z * (y / t); elseif (t <= 9.5e-157) tmp = x * (y / -t); elseif (t <= 4.9e+36) tmp = (z * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -9.2e+34], x, If[LessEqual[t, -5.4e-82], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e-157], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.9e+36], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+34}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -5.4 \cdot 10^{-82}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-157}:\\
\;\;\;\;x \cdot \frac{y}{-t}\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{+36}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -9.1999999999999993e34 or 4.89999999999999981e36 < t Initial program 82.1%
+-commutative82.1%
associate-/l*98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in y around 0 68.1%
if -9.1999999999999993e34 < t < -5.4000000000000003e-82Initial program 99.6%
+-commutative99.6%
associate-/l*85.7%
fma-define85.7%
Simplified85.7%
Taylor expanded in y around -inf 75.8%
Taylor expanded in z around inf 56.2%
associate-/l*46.8%
Simplified46.8%
*-commutative46.8%
associate-*l/56.2%
Applied egg-rr56.2%
associate-*r/56.4%
*-commutative56.4%
Applied egg-rr56.4%
if -5.4000000000000003e-82 < t < 9.50000000000000019e-157Initial program 99.9%
+-commutative99.9%
associate-/l*88.1%
fma-define88.1%
Simplified88.1%
Taylor expanded in y around -inf 90.6%
Taylor expanded in z around 0 64.0%
mul-1-neg64.0%
associate-/l*61.7%
distribute-rgt-neg-in61.7%
mul-1-neg61.7%
associate-*r/61.7%
mul-1-neg61.7%
Simplified61.7%
if 9.50000000000000019e-157 < t < 4.89999999999999981e36Initial program 99.8%
+-commutative99.8%
associate-/l*90.1%
fma-define90.1%
Simplified90.1%
Taylor expanded in y around -inf 71.1%
Taylor expanded in z around inf 54.7%
Final simplification62.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.95e-147) (not (<= x 9.2e-61))) (* x (- 1.0 (/ y t))) (* z (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.95e-147) || !(x <= 9.2e-61)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = z * (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 <= (-1.95d-147)) .or. (.not. (x <= 9.2d-61))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = z * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.95e-147) || !(x <= 9.2e-61)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.95e-147) or not (x <= 9.2e-61): tmp = x * (1.0 - (y / t)) else: tmp = z * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.95e-147) || !(x <= 9.2e-61)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(z * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.95e-147) || ~((x <= 9.2e-61))) tmp = x * (1.0 - (y / t)); else tmp = z * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.95e-147], N[Not[LessEqual[x, 9.2e-61]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{-147} \lor \neg \left(x \leq 9.2 \cdot 10^{-61}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if x < -1.9499999999999999e-147 or 9.19999999999999967e-61 < x Initial program 90.8%
+-commutative90.8%
associate-/l*92.5%
fma-define92.5%
Simplified92.5%
Taylor expanded in z around 0 77.9%
*-rgt-identity77.9%
mul-1-neg77.9%
associate-/l*84.4%
distribute-rgt-neg-in84.4%
mul-1-neg84.4%
distribute-lft-in84.4%
mul-1-neg84.4%
unsub-neg84.4%
Simplified84.4%
if -1.9499999999999999e-147 < x < 9.19999999999999967e-61Initial program 93.8%
+-commutative93.8%
associate-/l*93.9%
fma-define93.9%
Simplified93.9%
Taylor expanded in y around -inf 68.3%
Taylor expanded in z around inf 61.1%
associate-/l*61.2%
Simplified61.2%
*-commutative61.2%
associate-*l/61.1%
Applied egg-rr61.1%
associate-*r/66.3%
*-commutative66.3%
Applied egg-rr66.3%
Final simplification78.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1e+18) (not (<= y 9e+102))) (* y (/ (- z x) t)) (* x (/ (- t y) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e+18) || !(y <= 9e+102)) {
tmp = y * ((z - x) / 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 ((y <= (-1d+18)) .or. (.not. (y <= 9d+102))) then
tmp = y * ((z - x) / 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 ((y <= -1e+18) || !(y <= 9e+102)) {
tmp = y * ((z - x) / t);
} else {
tmp = x * ((t - y) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1e+18) or not (y <= 9e+102): tmp = y * ((z - x) / t) else: tmp = x * ((t - y) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1e+18) || !(y <= 9e+102)) tmp = Float64(y * Float64(Float64(z - x) / 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 ((y <= -1e+18) || ~((y <= 9e+102))) tmp = y * ((z - x) / t); else tmp = x * ((t - y) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1e+18], N[Not[LessEqual[y, 9e+102]], $MachinePrecision]], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(t - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+18} \lor \neg \left(y \leq 9 \cdot 10^{+102}\right):\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t - y}{t}\\
\end{array}
\end{array}
if y < -1e18 or 9.00000000000000042e102 < y Initial program 82.1%
+-commutative82.1%
associate-/l*97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in y around -inf 73.6%
associate-/l*97.9%
*-commutative97.9%
Applied egg-rr83.4%
if -1e18 < y < 9.00000000000000042e102Initial program 97.5%
+-commutative97.5%
associate-/l*89.9%
fma-define89.9%
Simplified89.9%
Taylor expanded in z around 0 76.3%
*-rgt-identity76.3%
mul-1-neg76.3%
associate-/l*78.8%
distribute-rgt-neg-in78.8%
mul-1-neg78.8%
distribute-lft-in78.8%
mul-1-neg78.8%
unsub-neg78.8%
Simplified78.8%
Taylor expanded in t around 0 78.8%
Final simplification80.5%
(FPCore (x y z t) :precision binary64 (if (<= x -2.9e+110) (* x (/ (- t y) t)) (if (<= x 2.7e-58) (+ x (* y (/ z t))) (* x (- 1.0 (/ y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.9e+110) {
tmp = x * ((t - y) / t);
} else if (x <= 2.7e-58) {
tmp = x + (y * (z / 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 (x <= (-2.9d+110)) then
tmp = x * ((t - y) / t)
else if (x <= 2.7d-58) then
tmp = x + (y * (z / 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 (x <= -2.9e+110) {
tmp = x * ((t - y) / t);
} else if (x <= 2.7e-58) {
tmp = x + (y * (z / t));
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.9e+110: tmp = x * ((t - y) / t) elif x <= 2.7e-58: tmp = x + (y * (z / t)) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.9e+110) tmp = Float64(x * Float64(Float64(t - y) / t)); elseif (x <= 2.7e-58) tmp = Float64(x + Float64(y * Float64(z / 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 (x <= -2.9e+110) tmp = x * ((t - y) / t); elseif (x <= 2.7e-58) tmp = x + (y * (z / t)); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.9e+110], N[(x * N[(N[(t - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-58], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+110}:\\
\;\;\;\;x \cdot \frac{t - y}{t}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-58}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if x < -2.9e110Initial program 87.0%
+-commutative87.0%
associate-/l*88.8%
fma-define88.8%
Simplified88.8%
Taylor expanded in z around 0 83.5%
*-rgt-identity83.5%
mul-1-neg83.5%
associate-/l*94.6%
distribute-rgt-neg-in94.6%
mul-1-neg94.6%
distribute-lft-in94.6%
mul-1-neg94.6%
unsub-neg94.6%
Simplified94.6%
Taylor expanded in t around 0 94.6%
if -2.9e110 < x < 2.6999999999999999e-58Initial program 94.1%
Taylor expanded in z around inf 82.3%
associate-/l*50.9%
Simplified83.8%
if 2.6999999999999999e-58 < x Initial program 90.7%
+-commutative90.7%
associate-/l*92.3%
fma-define92.3%
Simplified92.3%
Taylor expanded in z around 0 80.9%
*-rgt-identity80.9%
mul-1-neg80.9%
associate-/l*88.8%
distribute-rgt-neg-in88.8%
mul-1-neg88.8%
distribute-lft-in88.8%
mul-1-neg88.8%
unsub-neg88.8%
Simplified88.8%
Final simplification87.4%
(FPCore (x y z t) :precision binary64 (if (<= x -9.5e+109) (* x (/ (- t y) t)) (if (<= x 2.7e-58) (+ x (/ y (/ t z))) (* x (- 1.0 (/ y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -9.5e+109) {
tmp = x * ((t - y) / t);
} else if (x <= 2.7e-58) {
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 (x <= (-9.5d+109)) then
tmp = x * ((t - y) / t)
else if (x <= 2.7d-58) 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 (x <= -9.5e+109) {
tmp = x * ((t - y) / t);
} else if (x <= 2.7e-58) {
tmp = x + (y / (t / z));
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -9.5e+109: tmp = x * ((t - y) / t) elif x <= 2.7e-58: tmp = x + (y / (t / z)) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -9.5e+109) tmp = Float64(x * Float64(Float64(t - y) / t)); elseif (x <= 2.7e-58) tmp = Float64(x + Float64(y / Float64(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 (x <= -9.5e+109) tmp = x * ((t - y) / t); elseif (x <= 2.7e-58) tmp = x + (y / (t / z)); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -9.5e+109], N[(x * N[(N[(t - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-58], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+109}:\\
\;\;\;\;x \cdot \frac{t - y}{t}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-58}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if x < -9.49999999999999972e109Initial program 87.0%
+-commutative87.0%
associate-/l*88.8%
fma-define88.8%
Simplified88.8%
Taylor expanded in z around 0 83.5%
*-rgt-identity83.5%
mul-1-neg83.5%
associate-/l*94.6%
distribute-rgt-neg-in94.6%
mul-1-neg94.6%
distribute-lft-in94.6%
mul-1-neg94.6%
unsub-neg94.6%
Simplified94.6%
Taylor expanded in t around 0 94.6%
if -9.49999999999999972e109 < x < 2.6999999999999999e-58Initial program 94.1%
Taylor expanded in z around inf 82.3%
associate-/l*50.9%
Simplified83.8%
clear-num83.7%
un-div-inv83.8%
Applied egg-rr83.8%
if 2.6999999999999999e-58 < x Initial program 90.7%
+-commutative90.7%
associate-/l*92.3%
fma-define92.3%
Simplified92.3%
Taylor expanded in z around 0 80.9%
*-rgt-identity80.9%
mul-1-neg80.9%
associate-/l*88.8%
distribute-rgt-neg-in88.8%
mul-1-neg88.8%
distribute-lft-in88.8%
mul-1-neg88.8%
unsub-neg88.8%
Simplified88.8%
Final simplification87.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2.65e-138) (+ x (/ y (/ t z))) (if (<= z 7.2e-78) (* x (- 1.0 (/ y t))) (+ x (* z (/ y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.65e-138) {
tmp = x + (y / (t / z));
} else if (z <= 7.2e-78) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z * (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.65d-138)) then
tmp = x + (y / (t / z))
else if (z <= 7.2d-78) then
tmp = x * (1.0d0 - (y / t))
else
tmp = x + (z * (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.65e-138) {
tmp = x + (y / (t / z));
} else if (z <= 7.2e-78) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.65e-138: tmp = x + (y / (t / z)) elif z <= 7.2e-78: tmp = x * (1.0 - (y / t)) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.65e-138) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (z <= 7.2e-78) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.65e-138) tmp = x + (y / (t / z)); elseif (z <= 7.2e-78) tmp = x * (1.0 - (y / t)); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.65e-138], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-78], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{-138}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-78}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -2.65000000000000013e-138Initial program 92.5%
Taylor expanded in z around inf 84.2%
associate-/l*43.3%
Simplified85.4%
clear-num85.4%
un-div-inv85.4%
Applied egg-rr85.4%
if -2.65000000000000013e-138 < z < 7.2000000000000005e-78Initial program 94.1%
+-commutative94.1%
associate-/l*93.2%
fma-define93.2%
Simplified93.2%
Taylor expanded in z around 0 90.2%
*-rgt-identity90.2%
mul-1-neg90.2%
associate-/l*93.3%
distribute-rgt-neg-in93.3%
mul-1-neg93.3%
distribute-lft-in93.3%
mul-1-neg93.3%
unsub-neg93.3%
Simplified93.3%
if 7.2000000000000005e-78 < z Initial program 88.1%
+-commutative88.1%
associate-/l*92.8%
fma-define92.8%
Simplified92.8%
fma-undefine92.8%
associate-/l*88.1%
*-commutative88.1%
associate-/l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 75.9%
associate-*l/84.1%
*-commutative84.1%
Simplified84.1%
Final simplification88.0%
(FPCore (x y z t) :precision binary64 (if (<= z -2.2e-136) (+ x (/ y (/ t z))) (if (<= z 3.5e-75) (* x (- 1.0 (/ y t))) (+ x (/ z (/ t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e-136) {
tmp = x + (y / (t / z));
} else if (z <= 3.5e-75) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z / (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 (z <= (-2.2d-136)) then
tmp = x + (y / (t / z))
else if (z <= 3.5d-75) then
tmp = x * (1.0d0 - (y / t))
else
tmp = x + (z / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.2e-136) {
tmp = x + (y / (t / z));
} else if (z <= 3.5e-75) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z / (t / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.2e-136: tmp = x + (y / (t / z)) elif z <= 3.5e-75: tmp = x * (1.0 - (y / t)) else: tmp = x + (z / (t / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.2e-136) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (z <= 3.5e-75) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(z / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.2e-136) tmp = x + (y / (t / z)); elseif (z <= 3.5e-75) tmp = x * (1.0 - (y / t)); else tmp = x + (z / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.2e-136], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e-75], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-136}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-75}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -2.2000000000000001e-136Initial program 92.5%
Taylor expanded in z around inf 84.2%
associate-/l*43.3%
Simplified85.4%
clear-num85.4%
un-div-inv85.4%
Applied egg-rr85.4%
if -2.2000000000000001e-136 < z < 3.49999999999999985e-75Initial program 94.1%
+-commutative94.1%
associate-/l*93.2%
fma-define93.2%
Simplified93.2%
Taylor expanded in z around 0 90.2%
*-rgt-identity90.2%
mul-1-neg90.2%
associate-/l*93.3%
distribute-rgt-neg-in93.3%
mul-1-neg93.3%
distribute-lft-in93.3%
mul-1-neg93.3%
unsub-neg93.3%
Simplified93.3%
if 3.49999999999999985e-75 < z Initial program 88.1%
+-commutative88.1%
associate-/l*92.8%
fma-define92.8%
Simplified92.8%
fma-undefine92.8%
associate-/l*88.1%
*-commutative88.1%
associate-/l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 75.9%
associate-*l/84.1%
*-commutative84.1%
Simplified84.1%
clear-num84.0%
un-div-inv84.1%
Applied egg-rr84.1%
Final simplification88.0%
(FPCore (x y z t) :precision binary64 (if (<= t -1.45e-20) (+ x (/ y (/ t z))) (if (<= t 2e-74) (/ (* (- z x) y) t) (+ x (* z (/ y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.45e-20) {
tmp = x + (y / (t / z));
} else if (t <= 2e-74) {
tmp = ((z - x) * y) / t;
} else {
tmp = x + (z * (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 (t <= (-1.45d-20)) then
tmp = x + (y / (t / z))
else if (t <= 2d-74) then
tmp = ((z - x) * y) / t
else
tmp = x + (z * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.45e-20) {
tmp = x + (y / (t / z));
} else if (t <= 2e-74) {
tmp = ((z - x) * y) / t;
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.45e-20: tmp = x + (y / (t / z)) elif t <= 2e-74: tmp = ((z - x) * y) / t else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.45e-20) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (t <= 2e-74) tmp = Float64(Float64(Float64(z - x) * y) / t); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.45e-20) tmp = x + (y / (t / z)); elseif (t <= 2e-74) tmp = ((z - x) * y) / t; else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.45e-20], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e-74], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-20}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-74}:\\
\;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -1.45e-20Initial program 85.4%
Taylor expanded in z around inf 84.3%
associate-/l*28.1%
Simplified90.6%
clear-num90.7%
un-div-inv90.7%
Applied egg-rr90.7%
if -1.45e-20 < t < 1.99999999999999992e-74Initial program 99.8%
+-commutative99.8%
associate-/l*86.4%
fma-define86.4%
Simplified86.4%
Taylor expanded in y around -inf 87.8%
if 1.99999999999999992e-74 < t Initial program 86.5%
+-commutative86.5%
associate-/l*96.9%
fma-define96.9%
Simplified96.9%
fma-undefine96.9%
associate-/l*86.5%
*-commutative86.5%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 82.9%
associate-*l/88.1%
*-commutative88.1%
Simplified88.1%
Final simplification88.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.5e+17) (not (<= y 7.2e+102))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.5e+17) || !(y <= 7.2e+102)) {
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 <= (-2.5d+17)) .or. (.not. (y <= 7.2d+102))) 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 <= -2.5e+17) || !(y <= 7.2e+102)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.5e+17) or not (y <= 7.2e+102): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.5e+17) || !(y <= 7.2e+102)) 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 <= -2.5e+17) || ~((y <= 7.2e+102))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.5e+17], N[Not[LessEqual[y, 7.2e+102]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+17} \lor \neg \left(y \leq 7.2 \cdot 10^{+102}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.5e17 or 7.2000000000000003e102 < y Initial program 82.1%
+-commutative82.1%
associate-/l*97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in y around -inf 73.6%
Taylor expanded in z around inf 47.7%
associate-/l*55.6%
Simplified55.6%
if -2.5e17 < y < 7.2000000000000003e102Initial program 97.5%
+-commutative97.5%
associate-/l*89.9%
fma-define89.9%
Simplified89.9%
Taylor expanded in y around 0 59.0%
Final simplification57.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.8e+17) (not (<= y 7.3e+102))) (* z (/ y t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.8e+17) || !(y <= 7.3e+102)) {
tmp = z * (y / 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 <= (-2.8d+17)) .or. (.not. (y <= 7.3d+102))) then
tmp = z * (y / 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 <= -2.8e+17) || !(y <= 7.3e+102)) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.8e+17) or not (y <= 7.3e+102): tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.8e+17) || !(y <= 7.3e+102)) tmp = Float64(z * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.8e+17) || ~((y <= 7.3e+102))) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.8e+17], N[Not[LessEqual[y, 7.3e+102]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+17} \lor \neg \left(y \leq 7.3 \cdot 10^{+102}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.8e17 or 7.29999999999999989e102 < y Initial program 82.1%
+-commutative82.1%
associate-/l*97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in y around -inf 73.6%
Taylor expanded in z around inf 47.7%
associate-/l*55.6%
Simplified55.6%
*-commutative55.6%
associate-*l/47.7%
Applied egg-rr47.7%
associate-*r/60.4%
*-commutative60.4%
Applied egg-rr60.4%
if -2.8e17 < y < 7.29999999999999989e102Initial program 97.5%
+-commutative97.5%
associate-/l*89.9%
fma-define89.9%
Simplified89.9%
Taylor expanded in y around 0 59.0%
Final simplification59.5%
(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(y * Float64(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[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - x}{t}
\end{array}
Initial program 91.7%
associate-/l*92.9%
*-commutative92.9%
Applied egg-rr92.9%
Final simplification92.9%
(FPCore (x y z t) :precision binary64 (+ x (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
return x + ((z - x) * (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 + ((z - x) * (y / t))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / t));
}
def code(x, y, z, t): return x + ((z - x) * (y / t))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) * Float64(y / t))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) * (y / t)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - x\right) \cdot \frac{y}{t}
\end{array}
Initial program 91.7%
+-commutative91.7%
associate-/l*92.9%
fma-define92.9%
Simplified92.9%
fma-undefine92.9%
associate-/l*91.7%
*-commutative91.7%
associate-/l*98.0%
Applied egg-rr98.0%
Final simplification98.0%
(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.7%
+-commutative91.7%
associate-/l*92.9%
fma-define92.9%
Simplified92.9%
Taylor expanded in y around 0 42.4%
Final simplification42.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 2024077
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:alt
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))