
(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 14 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 (fma (- z x) (/ y t) x))
double code(double x, double y, double z, double t) {
return fma((z - x), (y / t), x);
}
function code(x, y, z, t) return fma(Float64(z - x), Float64(y / t), x) end
code[x_, y_, z_, t_] := N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z - x, \frac{y}{t}, x\right)
\end{array}
Initial program 94.7%
+-commutative94.7%
*-commutative94.7%
associate-/l*98.8%
fma-define98.8%
Applied egg-rr98.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z y) t)))
(if (<= t -1.6e+115)
x
(if (<= t -5.5e-88)
t_1
(if (<= t -1.1e-126)
(* z (/ x z))
(if (<= t 1.85e-298)
(* z (/ y t))
(if (<= t 2.45e-144)
(* x (/ y (- t)))
(if (<= t 8.5e-26) t_1 x))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * y) / t;
double tmp;
if (t <= -1.6e+115) {
tmp = x;
} else if (t <= -5.5e-88) {
tmp = t_1;
} else if (t <= -1.1e-126) {
tmp = z * (x / z);
} else if (t <= 1.85e-298) {
tmp = z * (y / t);
} else if (t <= 2.45e-144) {
tmp = x * (y / -t);
} else if (t <= 8.5e-26) {
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 <= (-1.6d+115)) then
tmp = x
else if (t <= (-5.5d-88)) then
tmp = t_1
else if (t <= (-1.1d-126)) then
tmp = z * (x / z)
else if (t <= 1.85d-298) then
tmp = z * (y / t)
else if (t <= 2.45d-144) then
tmp = x * (y / -t)
else if (t <= 8.5d-26) 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 <= -1.6e+115) {
tmp = x;
} else if (t <= -5.5e-88) {
tmp = t_1;
} else if (t <= -1.1e-126) {
tmp = z * (x / z);
} else if (t <= 1.85e-298) {
tmp = z * (y / t);
} else if (t <= 2.45e-144) {
tmp = x * (y / -t);
} else if (t <= 8.5e-26) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * y) / t tmp = 0 if t <= -1.6e+115: tmp = x elif t <= -5.5e-88: tmp = t_1 elif t <= -1.1e-126: tmp = z * (x / z) elif t <= 1.85e-298: tmp = z * (y / t) elif t <= 2.45e-144: tmp = x * (y / -t) elif t <= 8.5e-26: 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 <= -1.6e+115) tmp = x; elseif (t <= -5.5e-88) tmp = t_1; elseif (t <= -1.1e-126) tmp = Float64(z * Float64(x / z)); elseif (t <= 1.85e-298) tmp = Float64(z * Float64(y / t)); elseif (t <= 2.45e-144) tmp = Float64(x * Float64(y / Float64(-t))); elseif (t <= 8.5e-26) 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 <= -1.6e+115) tmp = x; elseif (t <= -5.5e-88) tmp = t_1; elseif (t <= -1.1e-126) tmp = z * (x / z); elseif (t <= 1.85e-298) tmp = z * (y / t); elseif (t <= 2.45e-144) tmp = x * (y / -t); elseif (t <= 8.5e-26) 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, -1.6e+115], x, If[LessEqual[t, -5.5e-88], t$95$1, If[LessEqual[t, -1.1e-126], N[(z * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.85e-298], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.45e-144], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-26], t$95$1, x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot y}{t}\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+115}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{-126}:\\
\;\;\;\;z \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{-298}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 2.45 \cdot 10^{-144}:\\
\;\;\;\;x \cdot \frac{y}{-t}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.6e115 or 8.50000000000000004e-26 < t Initial program 89.0%
Taylor expanded in y around 0 72.3%
if -1.6e115 < t < -5.49999999999999971e-88 or 2.45000000000000005e-144 < t < 8.50000000000000004e-26Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
associate-/l*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 58.9%
if -5.49999999999999971e-88 < t < -1.10000000000000007e-126Initial program 100.0%
Taylor expanded in z around inf 75.1%
Taylor expanded in z around inf 74.8%
Taylor expanded in x around inf 75.6%
if -1.10000000000000007e-126 < t < 1.8499999999999999e-298Initial program 99.9%
Taylor expanded in z around inf 69.7%
Taylor expanded in z around inf 73.5%
Taylor expanded in x around 0 66.8%
if 1.8499999999999999e-298 < t < 2.45000000000000005e-144Initial program 96.1%
+-commutative96.1%
*-commutative96.1%
associate-/l*96.6%
fma-define96.6%
Applied egg-rr96.6%
Taylor expanded in y around inf 81.1%
div-sub85.0%
associate-/l*92.6%
associate-*l/92.6%
Simplified92.6%
Taylor expanded in z around 0 66.9%
mul-1-neg66.9%
associate-/l*70.1%
distribute-lft-neg-out70.1%
*-commutative70.1%
Simplified70.1%
Final simplification67.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* z y) t)))
(if (<= t -1.6e+115)
x
(if (<= t -1.4e-82)
t_1
(if (<= t -1.2e-126)
(* z (/ x z))
(if (<= t 4.9e-297)
(* z (/ y t))
(if (<= t 1.22e-145)
(* (/ x t) (- y))
(if (<= t 3.4e-26) t_1 x))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * y) / t;
double tmp;
if (t <= -1.6e+115) {
tmp = x;
} else if (t <= -1.4e-82) {
tmp = t_1;
} else if (t <= -1.2e-126) {
tmp = z * (x / z);
} else if (t <= 4.9e-297) {
tmp = z * (y / t);
} else if (t <= 1.22e-145) {
tmp = (x / t) * -y;
} else if (t <= 3.4e-26) {
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 <= (-1.6d+115)) then
tmp = x
else if (t <= (-1.4d-82)) then
tmp = t_1
else if (t <= (-1.2d-126)) then
tmp = z * (x / z)
else if (t <= 4.9d-297) then
tmp = z * (y / t)
else if (t <= 1.22d-145) then
tmp = (x / t) * -y
else if (t <= 3.4d-26) 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 <= -1.6e+115) {
tmp = x;
} else if (t <= -1.4e-82) {
tmp = t_1;
} else if (t <= -1.2e-126) {
tmp = z * (x / z);
} else if (t <= 4.9e-297) {
tmp = z * (y / t);
} else if (t <= 1.22e-145) {
tmp = (x / t) * -y;
} else if (t <= 3.4e-26) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * y) / t tmp = 0 if t <= -1.6e+115: tmp = x elif t <= -1.4e-82: tmp = t_1 elif t <= -1.2e-126: tmp = z * (x / z) elif t <= 4.9e-297: tmp = z * (y / t) elif t <= 1.22e-145: tmp = (x / t) * -y elif t <= 3.4e-26: 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 <= -1.6e+115) tmp = x; elseif (t <= -1.4e-82) tmp = t_1; elseif (t <= -1.2e-126) tmp = Float64(z * Float64(x / z)); elseif (t <= 4.9e-297) tmp = Float64(z * Float64(y / t)); elseif (t <= 1.22e-145) tmp = Float64(Float64(x / t) * Float64(-y)); elseif (t <= 3.4e-26) 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 <= -1.6e+115) tmp = x; elseif (t <= -1.4e-82) tmp = t_1; elseif (t <= -1.2e-126) tmp = z * (x / z); elseif (t <= 4.9e-297) tmp = z * (y / t); elseif (t <= 1.22e-145) tmp = (x / t) * -y; elseif (t <= 3.4e-26) 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, -1.6e+115], x, If[LessEqual[t, -1.4e-82], t$95$1, If[LessEqual[t, -1.2e-126], N[(z * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.9e-297], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.22e-145], N[(N[(x / t), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[t, 3.4e-26], t$95$1, x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot y}{t}\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+115}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-126}:\\
\;\;\;\;z \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-297}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 1.22 \cdot 10^{-145}:\\
\;\;\;\;\frac{x}{t} \cdot \left(-y\right)\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.6e115 or 3.40000000000000013e-26 < t Initial program 89.0%
Taylor expanded in y around 0 72.3%
if -1.6e115 < t < -1.40000000000000012e-82 or 1.2199999999999999e-145 < t < 3.40000000000000013e-26Initial program 99.8%
+-commutative99.8%
*-commutative99.8%
associate-/l*99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 58.9%
if -1.40000000000000012e-82 < t < -1.20000000000000003e-126Initial program 100.0%
Taylor expanded in z around inf 75.1%
Taylor expanded in z around inf 74.8%
Taylor expanded in x around inf 75.6%
if -1.20000000000000003e-126 < t < 4.89999999999999997e-297Initial program 99.9%
Taylor expanded in z around inf 69.7%
Taylor expanded in z around inf 73.5%
Taylor expanded in x around 0 66.8%
if 4.89999999999999997e-297 < t < 1.2199999999999999e-145Initial program 96.1%
+-commutative96.1%
*-commutative96.1%
associate-/l*96.6%
fma-define96.6%
Applied egg-rr96.6%
Taylor expanded in y around inf 81.1%
div-sub85.0%
associate-/l*92.6%
associate-*l/92.6%
Simplified92.6%
Taylor expanded in z around 0 66.9%
mul-1-neg66.9%
associate-/l*70.1%
distribute-rgt-neg-in70.1%
distribute-frac-neg70.1%
associate-*r/66.9%
Simplified66.9%
Taylor expanded in x around 0 66.9%
mul-1-neg66.9%
associate-*r/70.1%
*-commutative70.1%
associate-*l/66.9%
distribute-frac-neg266.9%
associate-/l*70.0%
Simplified70.0%
Final simplification67.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (/ y t))) (t_2 (* x (- 1.0 (/ y t)))))
(if (<= z -3.2e+165)
t_1
(if (<= z -1.26e+110)
t_2
(if (<= z -5.2e+46) (/ (* z y) t) (if (<= z 1.8e+123) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (y / t);
double t_2 = x * (1.0 - (y / t));
double tmp;
if (z <= -3.2e+165) {
tmp = t_1;
} else if (z <= -1.26e+110) {
tmp = t_2;
} else if (z <= -5.2e+46) {
tmp = (z * y) / t;
} else if (z <= 1.8e+123) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = z * (y / t)
t_2 = x * (1.0d0 - (y / t))
if (z <= (-3.2d+165)) then
tmp = t_1
else if (z <= (-1.26d+110)) then
tmp = t_2
else if (z <= (-5.2d+46)) then
tmp = (z * y) / t
else if (z <= 1.8d+123) then
tmp = t_2
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 = z * (y / t);
double t_2 = x * (1.0 - (y / t));
double tmp;
if (z <= -3.2e+165) {
tmp = t_1;
} else if (z <= -1.26e+110) {
tmp = t_2;
} else if (z <= -5.2e+46) {
tmp = (z * y) / t;
} else if (z <= 1.8e+123) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (y / t) t_2 = x * (1.0 - (y / t)) tmp = 0 if z <= -3.2e+165: tmp = t_1 elif z <= -1.26e+110: tmp = t_2 elif z <= -5.2e+46: tmp = (z * y) / t elif z <= 1.8e+123: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(y / t)) t_2 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (z <= -3.2e+165) tmp = t_1; elseif (z <= -1.26e+110) tmp = t_2; elseif (z <= -5.2e+46) tmp = Float64(Float64(z * y) / t); elseif (z <= 1.8e+123) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (y / t); t_2 = x * (1.0 - (y / t)); tmp = 0.0; if (z <= -3.2e+165) tmp = t_1; elseif (z <= -1.26e+110) tmp = t_2; elseif (z <= -5.2e+46) tmp = (z * y) / t; elseif (z <= 1.8e+123) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+165], t$95$1, If[LessEqual[z, -1.26e+110], t$95$2, If[LessEqual[z, -5.2e+46], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.8e+123], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{t}\\
t_2 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.26 \cdot 10^{+110}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{+46}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+123}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.2e165 or 1.79999999999999999e123 < z Initial program 91.0%
Taylor expanded in z around inf 88.0%
Taylor expanded in z around inf 92.1%
Taylor expanded in x around 0 78.3%
if -3.2e165 < z < -1.25999999999999992e110 or -5.20000000000000027e46 < z < 1.79999999999999999e123Initial program 95.5%
Taylor expanded in x around inf 81.9%
mul-1-neg81.9%
unsub-neg81.9%
Simplified81.9%
if -1.25999999999999992e110 < z < -5.20000000000000027e46Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-/l*99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 67.8%
Final simplification80.0%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.45e+116)
x
(if (<= t -2.9e-85)
(/ (* z y) t)
(if (<= t -1.2e-126) (* z (/ x z)) (if (<= t 4.4e-26) (* z (/ y t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.45e+116) {
tmp = x;
} else if (t <= -2.9e-85) {
tmp = (z * y) / t;
} else if (t <= -1.2e-126) {
tmp = z * (x / z);
} else if (t <= 4.4e-26) {
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 <= (-1.45d+116)) then
tmp = x
else if (t <= (-2.9d-85)) then
tmp = (z * y) / t
else if (t <= (-1.2d-126)) then
tmp = z * (x / z)
else if (t <= 4.4d-26) 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 <= -1.45e+116) {
tmp = x;
} else if (t <= -2.9e-85) {
tmp = (z * y) / t;
} else if (t <= -1.2e-126) {
tmp = z * (x / z);
} else if (t <= 4.4e-26) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.45e+116: tmp = x elif t <= -2.9e-85: tmp = (z * y) / t elif t <= -1.2e-126: tmp = z * (x / z) elif t <= 4.4e-26: tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.45e+116) tmp = x; elseif (t <= -2.9e-85) tmp = Float64(Float64(z * y) / t); elseif (t <= -1.2e-126) tmp = Float64(z * Float64(x / z)); elseif (t <= 4.4e-26) 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 (t <= -1.45e+116) tmp = x; elseif (t <= -2.9e-85) tmp = (z * y) / t; elseif (t <= -1.2e-126) tmp = z * (x / z); elseif (t <= 4.4e-26) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.45e+116], x, If[LessEqual[t, -2.9e-85], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, -1.2e-126], N[(z * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e-26], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+116}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -2.9 \cdot 10^{-85}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-126}:\\
\;\;\;\;z \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-26}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.4500000000000001e116 or 4.4000000000000002e-26 < t Initial program 89.0%
Taylor expanded in y around 0 72.3%
if -1.4500000000000001e116 < t < -2.9000000000000002e-85Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-/l*99.6%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 60.9%
if -2.9000000000000002e-85 < t < -1.20000000000000003e-126Initial program 100.0%
Taylor expanded in z around inf 75.1%
Taylor expanded in z around inf 74.8%
Taylor expanded in x around inf 75.6%
if -1.20000000000000003e-126 < t < 4.4000000000000002e-26Initial program 98.9%
Taylor expanded in z around inf 66.0%
Taylor expanded in z around inf 66.8%
Taylor expanded in x around 0 56.8%
Final simplification64.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -1.65e+115)
x
(if (<= t -9.8e-88)
(* y (/ z t))
(if (<= t -1.2e-126) (* z (/ x z)) (if (<= t 6.5e-26) (* z (/ y t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.65e+115) {
tmp = x;
} else if (t <= -9.8e-88) {
tmp = y * (z / t);
} else if (t <= -1.2e-126) {
tmp = z * (x / z);
} else if (t <= 6.5e-26) {
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 <= (-1.65d+115)) then
tmp = x
else if (t <= (-9.8d-88)) then
tmp = y * (z / t)
else if (t <= (-1.2d-126)) then
tmp = z * (x / z)
else if (t <= 6.5d-26) 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 <= -1.65e+115) {
tmp = x;
} else if (t <= -9.8e-88) {
tmp = y * (z / t);
} else if (t <= -1.2e-126) {
tmp = z * (x / z);
} else if (t <= 6.5e-26) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.65e+115: tmp = x elif t <= -9.8e-88: tmp = y * (z / t) elif t <= -1.2e-126: tmp = z * (x / z) elif t <= 6.5e-26: tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.65e+115) tmp = x; elseif (t <= -9.8e-88) tmp = Float64(y * Float64(z / t)); elseif (t <= -1.2e-126) tmp = Float64(z * Float64(x / z)); elseif (t <= 6.5e-26) 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 (t <= -1.65e+115) tmp = x; elseif (t <= -9.8e-88) tmp = y * (z / t); elseif (t <= -1.2e-126) tmp = z * (x / z); elseif (t <= 6.5e-26) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.65e+115], x, If[LessEqual[t, -9.8e-88], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.2e-126], N[(z * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e-26], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{+115}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -9.8 \cdot 10^{-88}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-126}:\\
\;\;\;\;z \cdot \frac{x}{z}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-26}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.65000000000000003e115 or 6.5e-26 < t Initial program 89.0%
Taylor expanded in y around 0 72.3%
if -1.65000000000000003e115 < t < -9.80000000000000055e-88Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-/l*99.6%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 60.9%
associate-*r/60.8%
Simplified60.8%
if -9.80000000000000055e-88 < t < -1.20000000000000003e-126Initial program 100.0%
Taylor expanded in z around inf 75.1%
Taylor expanded in z around inf 74.8%
Taylor expanded in x around inf 75.6%
if -1.20000000000000003e-126 < t < 6.5e-26Initial program 98.9%
Taylor expanded in z around inf 66.0%
Taylor expanded in z around inf 66.8%
Taylor expanded in x around 0 56.8%
(FPCore (x y z t) :precision binary64 (if (<= z -2.6e-58) (+ x (/ (* z y) t)) (if (<= z 4e-38) (* x (- 1.0 (/ y t))) (* z (+ (/ y t) (/ x z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.6e-58) {
tmp = x + ((z * y) / t);
} else if (z <= 4e-38) {
tmp = x * (1.0 - (y / t));
} else {
tmp = z * ((y / t) + (x / z));
}
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.6d-58)) then
tmp = x + ((z * y) / t)
else if (z <= 4d-38) then
tmp = x * (1.0d0 - (y / t))
else
tmp = z * ((y / t) + (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.6e-58) {
tmp = x + ((z * y) / t);
} else if (z <= 4e-38) {
tmp = x * (1.0 - (y / t));
} else {
tmp = z * ((y / t) + (x / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.6e-58: tmp = x + ((z * y) / t) elif z <= 4e-38: tmp = x * (1.0 - (y / t)) else: tmp = z * ((y / t) + (x / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.6e-58) tmp = Float64(x + Float64(Float64(z * y) / t)); elseif (z <= 4e-38) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(z * Float64(Float64(y / t) + Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.6e-58) tmp = x + ((z * y) / t); elseif (z <= 4e-38) tmp = x * (1.0 - (y / t)); else tmp = z * ((y / t) + (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.6e-58], N[(x + N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-38], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y / t), $MachinePrecision] + N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-58}:\\
\;\;\;\;x + \frac{z \cdot y}{t}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-38}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{y}{t} + \frac{x}{z}\right)\\
\end{array}
\end{array}
if z < -2.60000000000000007e-58Initial program 97.5%
Taylor expanded in z around inf 89.9%
if -2.60000000000000007e-58 < z < 3.9999999999999998e-38Initial program 94.5%
Taylor expanded in x around inf 91.5%
mul-1-neg91.5%
unsub-neg91.5%
Simplified91.5%
if 3.9999999999999998e-38 < z Initial program 91.8%
Taylor expanded in z around inf 87.0%
Taylor expanded in z around inf 92.4%
Final simplification91.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.15e-100) (not (<= t 5.4e-98))) (+ x (* y (/ z t))) (/ (* (- z x) y) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.15e-100) || !(t <= 5.4e-98)) {
tmp = x + (y * (z / t));
} else {
tmp = ((z - x) * y) / t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.15d-100)) .or. (.not. (t <= 5.4d-98))) then
tmp = x + (y * (z / t))
else
tmp = ((z - x) * 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.15e-100) || !(t <= 5.4e-98)) {
tmp = x + (y * (z / t));
} else {
tmp = ((z - x) * y) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.15e-100) or not (t <= 5.4e-98): tmp = x + (y * (z / t)) else: tmp = ((z - x) * y) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.15e-100) || !(t <= 5.4e-98)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(Float64(Float64(z - x) * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.15e-100) || ~((t <= 5.4e-98))) tmp = x + (y * (z / t)); else tmp = ((z - x) * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.15e-100], N[Not[LessEqual[t, 5.4e-98]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{-100} \lor \neg \left(t \leq 5.4 \cdot 10^{-98}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\
\end{array}
\end{array}
if t < -1.14999999999999997e-100 or 5.3999999999999997e-98 < t Initial program 92.5%
Taylor expanded in z around inf 88.0%
associate-/l*90.7%
Simplified90.7%
if -1.14999999999999997e-100 < t < 5.3999999999999997e-98Initial program 98.8%
Taylor expanded in y around -inf 89.9%
Final simplification90.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.5e-104) (not (<= t 7e-96))) (+ x (* y (/ z t))) (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.5e-104) || !(t <= 7e-96)) {
tmp = x + (y * (z / t));
} else {
tmp = (z - x) * (y / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-5.5d-104)) .or. (.not. (t <= 7d-96))) then
tmp = x + (y * (z / t))
else
tmp = (z - x) * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.5e-104) || !(t <= 7e-96)) {
tmp = x + (y * (z / t));
} else {
tmp = (z - x) * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.5e-104) or not (t <= 7e-96): tmp = x + (y * (z / t)) else: tmp = (z - x) * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.5e-104) || !(t <= 7e-96)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(Float64(z - x) * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -5.5e-104) || ~((t <= 7e-96))) tmp = x + (y * (z / t)); else tmp = (z - x) * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.5e-104], N[Not[LessEqual[t, 7e-96]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-104} \lor \neg \left(t \leq 7 \cdot 10^{-96}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -5.4999999999999998e-104 or 6.9999999999999998e-96 < t Initial program 92.5%
Taylor expanded in z around inf 88.0%
associate-/l*90.7%
Simplified90.7%
if -5.4999999999999998e-104 < t < 6.9999999999999998e-96Initial program 98.8%
+-commutative98.8%
*-commutative98.8%
associate-/l*97.8%
fma-define97.8%
Applied egg-rr97.8%
Taylor expanded in y around inf 73.8%
div-sub78.2%
associate-/l*89.9%
associate-*l/88.8%
Simplified88.8%
Final simplification90.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.55e+71) (not (<= t 6.4e-26))) (* x (- 1.0 (/ y t))) (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.55e+71) || !(t <= 6.4e-26)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = (z - x) * (y / t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.55d+71)) .or. (.not. (t <= 6.4d-26))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = (z - x) * (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.55e+71) || !(t <= 6.4e-26)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = (z - x) * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.55e+71) or not (t <= 6.4e-26): tmp = x * (1.0 - (y / t)) else: tmp = (z - x) * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.55e+71) || !(t <= 6.4e-26)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(Float64(z - x) * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.55e+71) || ~((t <= 6.4e-26))) tmp = x * (1.0 - (y / t)); else tmp = (z - x) * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.55e+71], N[Not[LessEqual[t, 6.4e-26]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+71} \lor \neg \left(t \leq 6.4 \cdot 10^{-26}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -1.55000000000000009e71 or 6.4000000000000002e-26 < t Initial program 89.6%
Taylor expanded in x around inf 78.6%
mul-1-neg78.6%
unsub-neg78.6%
Simplified78.6%
if -1.55000000000000009e71 < t < 6.4000000000000002e-26Initial program 99.2%
+-commutative99.2%
*-commutative99.2%
associate-/l*98.5%
fma-define98.5%
Applied egg-rr98.5%
Taylor expanded in y around inf 71.1%
div-sub74.1%
associate-/l*81.7%
associate-*l/80.9%
Simplified80.9%
Final simplification79.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -7e-83) (not (<= x 3.1e-25))) (* x (- 1.0 (/ y t))) (* y (/ (- z x) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7e-83) || !(x <= 3.1e-25)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * ((z - x) / 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 <= (-7d-83)) .or. (.not. (x <= 3.1d-25))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = y * ((z - x) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7e-83) || !(x <= 3.1e-25)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * ((z - x) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7e-83) or not (x <= 3.1e-25): tmp = x * (1.0 - (y / t)) else: tmp = y * ((z - x) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7e-83) || !(x <= 3.1e-25)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(y * Float64(Float64(z - x) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7e-83) || ~((x <= 3.1e-25))) tmp = x * (1.0 - (y / t)); else tmp = y * ((z - x) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7e-83], N[Not[LessEqual[x, 3.1e-25]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-83} \lor \neg \left(x \leq 3.1 \cdot 10^{-25}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\end{array}
\end{array}
if x < -7.00000000000000061e-83 or 3.09999999999999995e-25 < x Initial program 94.1%
Taylor expanded in x around inf 84.1%
mul-1-neg84.1%
unsub-neg84.1%
Simplified84.1%
if -7.00000000000000061e-83 < x < 3.09999999999999995e-25Initial program 95.8%
+-commutative95.8%
*-commutative95.8%
associate-/l*96.8%
fma-define96.8%
Applied egg-rr96.8%
Taylor expanded in y around inf 69.6%
div-sub69.6%
Simplified69.6%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.02e+46) (not (<= z 3.7e-53))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.02e+46) || !(z <= 3.7e-53)) {
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 ((z <= (-1.02d+46)) .or. (.not. (z <= 3.7d-53))) 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 ((z <= -1.02e+46) || !(z <= 3.7e-53)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.02e+46) or not (z <= 3.7e-53): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.02e+46) || !(z <= 3.7e-53)) 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 ((z <= -1.02e+46) || ~((z <= 3.7e-53))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.02e+46], N[Not[LessEqual[z, 3.7e-53]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+46} \lor \neg \left(z \leq 3.7 \cdot 10^{-53}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.0199999999999999e46 or 3.69999999999999982e-53 < z Initial program 94.2%
+-commutative94.2%
*-commutative94.2%
associate-/l*98.5%
fma-define98.5%
Applied egg-rr98.5%
Taylor expanded in z around inf 61.7%
associate-*r/60.1%
Simplified60.1%
if -1.0199999999999999e46 < z < 3.69999999999999982e-53Initial program 95.2%
Taylor expanded in y around 0 59.6%
Final simplification59.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 94.7%
Taylor expanded in z around 0 90.4%
+-commutative90.4%
*-commutative90.4%
associate-*r/89.6%
mul-1-neg89.6%
associate-/l*92.1%
distribute-lft-neg-in92.1%
distribute-rgt-in98.8%
sub-neg98.8%
Simplified98.8%
Final simplification98.8%
(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 94.7%
Taylor expanded in y around 0 43.0%
(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 2024108
(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)))