
(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 15 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 5e+298)))
(+ 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 <= 5e+298)) {
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 <= 5e+298)) {
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 <= 5e+298): 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 <= 5e+298)) 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 <= 5e+298))) 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, 5e+298]], $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 5 \cdot 10^{+298}\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 5.0000000000000003e298 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 75.0%
associate-/l*99.9%
*-commutative99.9%
Applied egg-rr99.9%
if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 5.0000000000000003e298Initial program 99.2%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- (/ y t)))) (t_2 (* z (/ y t))))
(if (<= z -6.2e+56)
t_2
(if (<= z -3.25e-195)
x
(if (<= z -4e-239)
t_1
(if (<= z 2.5e-264)
x
(if (<= z 1.12e-64) t_1 (if (<= z 360000.0) x t_2))))))))
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 (z <= -6.2e+56) {
tmp = t_2;
} else if (z <= -3.25e-195) {
tmp = x;
} else if (z <= -4e-239) {
tmp = t_1;
} else if (z <= 2.5e-264) {
tmp = x;
} else if (z <= 1.12e-64) {
tmp = t_1;
} else if (z <= 360000.0) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * -(y / t)
t_2 = z * (y / t)
if (z <= (-6.2d+56)) then
tmp = t_2
else if (z <= (-3.25d-195)) then
tmp = x
else if (z <= (-4d-239)) then
tmp = t_1
else if (z <= 2.5d-264) then
tmp = x
else if (z <= 1.12d-64) then
tmp = t_1
else if (z <= 360000.0d0) then
tmp = x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * -(y / t);
double t_2 = z * (y / t);
double tmp;
if (z <= -6.2e+56) {
tmp = t_2;
} else if (z <= -3.25e-195) {
tmp = x;
} else if (z <= -4e-239) {
tmp = t_1;
} else if (z <= 2.5e-264) {
tmp = x;
} else if (z <= 1.12e-64) {
tmp = t_1;
} else if (z <= 360000.0) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * -(y / t) t_2 = z * (y / t) tmp = 0 if z <= -6.2e+56: tmp = t_2 elif z <= -3.25e-195: tmp = x elif z <= -4e-239: tmp = t_1 elif z <= 2.5e-264: tmp = x elif z <= 1.12e-64: tmp = t_1 elif z <= 360000.0: tmp = x else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-Float64(y / t))) t_2 = Float64(z * Float64(y / t)) tmp = 0.0 if (z <= -6.2e+56) tmp = t_2; elseif (z <= -3.25e-195) tmp = x; elseif (z <= -4e-239) tmp = t_1; elseif (z <= 2.5e-264) tmp = x; elseif (z <= 1.12e-64) tmp = t_1; elseif (z <= 360000.0) tmp = x; else tmp = t_2; 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 (z <= -6.2e+56) tmp = t_2; elseif (z <= -3.25e-195) tmp = x; elseif (z <= -4e-239) tmp = t_1; elseif (z <= 2.5e-264) tmp = x; elseif (z <= 1.12e-64) tmp = t_1; elseif (z <= 360000.0) tmp = x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-N[(y / t), $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e+56], t$95$2, If[LessEqual[z, -3.25e-195], x, If[LessEqual[z, -4e-239], t$95$1, If[LessEqual[z, 2.5e-264], x, If[LessEqual[z, 1.12e-64], t$95$1, If[LessEqual[z, 360000.0], x, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-\frac{y}{t}\right)\\
t_2 := z \cdot \frac{y}{t}\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+56}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.25 \cdot 10^{-195}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-239}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-264}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 360000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.20000000000000009e56 or 3.6e5 < z Initial program 87.5%
+-commutative87.5%
associate-/l*91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in y around -inf 67.0%
associate-/l*91.5%
*-commutative91.5%
Applied egg-rr71.9%
Taylor expanded in z around inf 58.6%
associate-*l/66.0%
Simplified66.0%
if -6.20000000000000009e56 < z < -3.25000000000000002e-195 or -4.0000000000000003e-239 < z < 2.5e-264 or 1.12e-64 < z < 3.6e5Initial program 90.9%
+-commutative90.9%
associate-/l*96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in y around 0 60.1%
if -3.25000000000000002e-195 < z < -4.0000000000000003e-239 or 2.5e-264 < z < 1.12e-64Initial program 95.9%
+-commutative95.9%
associate-/l*91.7%
fma-define91.7%
Simplified91.7%
Taylor expanded in y around -inf 72.2%
Taylor expanded in z around 0 63.3%
mul-1-neg63.3%
associate-/l*67.2%
distribute-rgt-neg-in67.2%
distribute-neg-frac267.2%
Simplified67.2%
Final simplification64.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y t)))))
(if (<= x -6.5e+62)
t_1
(if (<= x 2.5e-74)
(+ x (* y (/ z t)))
(if (<= x 2.9e+28) (* y (/ (- z x) t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double tmp;
if (x <= -6.5e+62) {
tmp = t_1;
} else if (x <= 2.5e-74) {
tmp = x + (y * (z / t));
} else if (x <= 2.9e+28) {
tmp = y * ((z - x) / 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 * (1.0d0 - (y / t))
if (x <= (-6.5d+62)) then
tmp = t_1
else if (x <= 2.5d-74) then
tmp = x + (y * (z / t))
else if (x <= 2.9d+28) then
tmp = y * ((z - x) / 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 * (1.0 - (y / t));
double tmp;
if (x <= -6.5e+62) {
tmp = t_1;
} else if (x <= 2.5e-74) {
tmp = x + (y * (z / t));
} else if (x <= 2.9e+28) {
tmp = y * ((z - x) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) tmp = 0 if x <= -6.5e+62: tmp = t_1 elif x <= 2.5e-74: tmp = x + (y * (z / t)) elif x <= 2.9e+28: tmp = y * ((z - x) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (x <= -6.5e+62) tmp = t_1; elseif (x <= 2.5e-74) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (x <= 2.9e+28) tmp = 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 * (1.0 - (y / t)); tmp = 0.0; if (x <= -6.5e+62) tmp = t_1; elseif (x <= 2.5e-74) tmp = x + (y * (z / t)); elseif (x <= 2.9e+28) tmp = 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[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e+62], t$95$1, If[LessEqual[x, 2.5e-74], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e+28], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-74}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+28}:\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.5000000000000003e62 or 2.9000000000000001e28 < x Initial program 90.5%
+-commutative90.5%
associate-/l*91.1%
fma-define91.1%
Simplified91.1%
Taylor expanded in z around 0 83.1%
mul-1-neg83.1%
*-rgt-identity83.1%
associate-/l*91.8%
distribute-rgt-neg-in91.8%
mul-1-neg91.8%
distribute-lft-in91.7%
mul-1-neg91.7%
unsub-neg91.7%
Simplified91.7%
if -6.5000000000000003e62 < x < 2.49999999999999999e-74Initial program 89.9%
Taylor expanded in z around inf 81.6%
associate-/l*55.3%
Simplified89.0%
if 2.49999999999999999e-74 < x < 2.9000000000000001e28Initial program 91.4%
+-commutative91.4%
associate-/l*91.6%
fma-define91.6%
Simplified91.6%
Taylor expanded in y around -inf 83.0%
associate-/l*91.6%
*-commutative91.6%
Applied egg-rr83.2%
Final simplification89.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 (/ y t)))))
(if (<= x -8e+64)
t_1
(if (<= x 1.35e-73)
(+ x (/ y (/ t z)))
(if (<= x 6.1e+28) (* y (/ (- z x) t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double tmp;
if (x <= -8e+64) {
tmp = t_1;
} else if (x <= 1.35e-73) {
tmp = x + (y / (t / z));
} else if (x <= 6.1e+28) {
tmp = y * ((z - x) / 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 * (1.0d0 - (y / t))
if (x <= (-8d+64)) then
tmp = t_1
else if (x <= 1.35d-73) then
tmp = x + (y / (t / z))
else if (x <= 6.1d+28) then
tmp = y * ((z - x) / 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 * (1.0 - (y / t));
double tmp;
if (x <= -8e+64) {
tmp = t_1;
} else if (x <= 1.35e-73) {
tmp = x + (y / (t / z));
} else if (x <= 6.1e+28) {
tmp = y * ((z - x) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) tmp = 0 if x <= -8e+64: tmp = t_1 elif x <= 1.35e-73: tmp = x + (y / (t / z)) elif x <= 6.1e+28: tmp = y * ((z - x) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (x <= -8e+64) tmp = t_1; elseif (x <= 1.35e-73) tmp = Float64(x + Float64(y / Float64(t / z))); elseif (x <= 6.1e+28) tmp = 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 * (1.0 - (y / t)); tmp = 0.0; if (x <= -8e+64) tmp = t_1; elseif (x <= 1.35e-73) tmp = x + (y / (t / z)); elseif (x <= 6.1e+28) tmp = 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[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+64], t$95$1, If[LessEqual[x, 1.35e-73], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.1e+28], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-73}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;x \leq 6.1 \cdot 10^{+28}:\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.00000000000000017e64 or 6.1000000000000002e28 < x Initial program 90.5%
+-commutative90.5%
associate-/l*91.1%
fma-define91.1%
Simplified91.1%
Taylor expanded in z around 0 83.1%
mul-1-neg83.1%
*-rgt-identity83.1%
associate-/l*91.8%
distribute-rgt-neg-in91.8%
mul-1-neg91.8%
distribute-lft-in91.7%
mul-1-neg91.7%
unsub-neg91.7%
Simplified91.7%
if -8.00000000000000017e64 < x < 1.34999999999999997e-73Initial program 89.9%
Taylor expanded in z around inf 81.6%
associate-/l*55.3%
Simplified89.0%
clear-num88.9%
un-div-inv89.0%
Applied egg-rr89.0%
if 1.34999999999999997e-73 < x < 6.1000000000000002e28Initial program 91.4%
+-commutative91.4%
associate-/l*91.6%
fma-define91.6%
Simplified91.6%
Taylor expanded in y around -inf 83.0%
associate-/l*91.6%
*-commutative91.6%
Applied egg-rr83.2%
Final simplification89.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.3e-99) (not (<= t 1.7e-160))) (+ x (* y (/ (- z x) t))) (/ (* (- z x) y) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.3e-99) || !(t <= 1.7e-160)) {
tmp = x + (y * ((z - x) / 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.3d-99)) .or. (.not. (t <= 1.7d-160))) then
tmp = x + (y * ((z - x) / 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.3e-99) || !(t <= 1.7e-160)) {
tmp = x + (y * ((z - x) / t));
} else {
tmp = ((z - x) * y) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.3e-99) or not (t <= 1.7e-160): tmp = x + (y * ((z - x) / t)) else: tmp = ((z - x) * y) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.3e-99) || !(t <= 1.7e-160)) tmp = Float64(x + Float64(y * Float64(Float64(z - x) / 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 <= -5.3e-99) || ~((t <= 1.7e-160))) tmp = x + (y * ((z - x) / t)); else tmp = ((z - x) * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.3e-99], N[Not[LessEqual[t, 1.7e-160]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.3 \cdot 10^{-99} \lor \neg \left(t \leq 1.7 \cdot 10^{-160}\right):\\
\;\;\;\;x + y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\
\end{array}
\end{array}
if t < -5.3000000000000003e-99 or 1.70000000000000011e-160 < t Initial program 85.8%
associate-/l*98.7%
*-commutative98.7%
Applied egg-rr98.7%
if -5.3000000000000003e-99 < t < 1.70000000000000011e-160Initial program 98.7%
+-commutative98.7%
associate-/l*83.9%
fma-define83.9%
Simplified83.9%
Taylor expanded in y around -inf 93.2%
Final simplification96.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -92000000000000.0) (not (<= z 1.95e-64))) (+ x (* z (/ y t))) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -92000000000000.0) || !(z <= 1.95e-64)) {
tmp = x + (z * (y / 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 <= (-92000000000000.0d0)) .or. (.not. (z <= 1.95d-64))) then
tmp = x + (z * (y / 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 <= -92000000000000.0) || !(z <= 1.95e-64)) {
tmp = x + (z * (y / t));
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -92000000000000.0) or not (z <= 1.95e-64): tmp = x + (z * (y / t)) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -92000000000000.0) || !(z <= 1.95e-64)) tmp = Float64(x + Float64(z * Float64(y / 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 <= -92000000000000.0) || ~((z <= 1.95e-64))) tmp = x + (z * (y / t)); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -92000000000000.0], N[Not[LessEqual[z, 1.95e-64]], $MachinePrecision]], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -92000000000000 \lor \neg \left(z \leq 1.95 \cdot 10^{-64}\right):\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if z < -9.2e13 or 1.9499999999999998e-64 < z Initial program 88.7%
+-commutative88.7%
associate-/l*91.9%
fma-define91.9%
Simplified91.9%
fma-undefine91.9%
associate-/l*88.7%
*-commutative88.7%
associate-/l*97.2%
Applied egg-rr97.2%
Taylor expanded in z around inf 81.8%
associate-*l/86.9%
*-commutative86.9%
Simplified86.9%
if -9.2e13 < z < 1.9499999999999998e-64Initial program 92.4%
+-commutative92.4%
associate-/l*95.6%
fma-define95.6%
Simplified95.6%
Taylor expanded in z around 0 87.0%
mul-1-neg87.0%
*-rgt-identity87.0%
associate-/l*92.0%
distribute-rgt-neg-in92.0%
mul-1-neg92.0%
distribute-lft-in92.0%
mul-1-neg92.0%
unsub-neg92.0%
Simplified92.0%
Final simplification89.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -30000000000000.0) (not (<= z 2.45e-64))) (+ x (* z (/ y t))) (- x (* x (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -30000000000000.0) || !(z <= 2.45e-64)) {
tmp = x + (z * (y / t));
} else {
tmp = x - (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 ((z <= (-30000000000000.0d0)) .or. (.not. (z <= 2.45d-64))) then
tmp = x + (z * (y / t))
else
tmp = x - (x * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -30000000000000.0) || !(z <= 2.45e-64)) {
tmp = x + (z * (y / t));
} else {
tmp = x - (x * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -30000000000000.0) or not (z <= 2.45e-64): tmp = x + (z * (y / t)) else: tmp = x - (x * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -30000000000000.0) || !(z <= 2.45e-64)) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(x - Float64(x * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -30000000000000.0) || ~((z <= 2.45e-64))) tmp = x + (z * (y / t)); else tmp = x - (x * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -30000000000000.0], N[Not[LessEqual[z, 2.45e-64]], $MachinePrecision]], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -30000000000000 \lor \neg \left(z \leq 2.45 \cdot 10^{-64}\right):\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -3e13 or 2.4500000000000001e-64 < z Initial program 88.7%
+-commutative88.7%
associate-/l*91.9%
fma-define91.9%
Simplified91.9%
fma-undefine91.9%
associate-/l*88.7%
*-commutative88.7%
associate-/l*97.2%
Applied egg-rr97.2%
Taylor expanded in z around inf 81.8%
associate-*l/86.9%
*-commutative86.9%
Simplified86.9%
if -3e13 < z < 2.4500000000000001e-64Initial program 92.4%
Taylor expanded in z around 0 87.0%
mul-1-neg45.9%
associate-/l*46.7%
distribute-rgt-neg-in46.7%
distribute-neg-frac246.7%
Simplified92.0%
*-commutative92.0%
add-sqr-sqrt51.4%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod18.7%
add-sqr-sqrt45.2%
cancel-sign-sub45.2%
distribute-frac-neg245.2%
*-commutative45.2%
add-sqr-sqrt26.5%
sqrt-unprod59.5%
sqr-neg59.5%
sqrt-unprod40.5%
add-sqr-sqrt92.0%
Applied egg-rr92.0%
Final simplification89.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.2e+14) (not (<= z 2.3e-64))) (+ x (* z (/ y t))) (- x (/ x (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.2e+14) || !(z <= 2.3e-64)) {
tmp = x + (z * (y / t));
} else {
tmp = x - (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 ((z <= (-1.2d+14)) .or. (.not. (z <= 2.3d-64))) then
tmp = x + (z * (y / t))
else
tmp = x - (x / (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.2e+14) || !(z <= 2.3e-64)) {
tmp = x + (z * (y / t));
} else {
tmp = x - (x / (t / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.2e+14) or not (z <= 2.3e-64): tmp = x + (z * (y / t)) else: tmp = x - (x / (t / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.2e+14) || !(z <= 2.3e-64)) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(x - Float64(x / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.2e+14) || ~((z <= 2.3e-64))) tmp = x + (z * (y / t)); else tmp = x - (x / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.2e+14], N[Not[LessEqual[z, 2.3e-64]], $MachinePrecision]], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+14} \lor \neg \left(z \leq 2.3 \cdot 10^{-64}\right):\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -1.2e14 or 2.3000000000000001e-64 < z Initial program 88.7%
+-commutative88.7%
associate-/l*91.9%
fma-define91.9%
Simplified91.9%
fma-undefine91.9%
associate-/l*88.7%
*-commutative88.7%
associate-/l*97.2%
Applied egg-rr97.2%
Taylor expanded in z around inf 81.8%
associate-*l/86.9%
*-commutative86.9%
Simplified86.9%
if -1.2e14 < z < 2.3000000000000001e-64Initial program 92.4%
Taylor expanded in z around 0 87.0%
mul-1-neg45.9%
associate-/l*46.7%
distribute-rgt-neg-in46.7%
distribute-neg-frac246.7%
Simplified92.0%
*-commutative92.0%
add-sqr-sqrt51.4%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod18.7%
add-sqr-sqrt45.2%
cancel-sign-sub45.2%
distribute-frac-neg245.2%
*-commutative45.2%
add-sqr-sqrt26.5%
sqrt-unprod59.5%
sqr-neg59.5%
sqrt-unprod40.5%
add-sqr-sqrt92.0%
Applied egg-rr92.0%
clear-num92.0%
div-inv92.5%
Applied egg-rr92.5%
Final simplification89.4%
(FPCore (x y z t) :precision binary64 (if (<= z -5.5e+186) (/ (* z y) t) (if (<= z 11200000.0) (* x (- 1.0 (/ y t))) (* z (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.5e+186) {
tmp = (z * y) / t;
} else if (z <= 11200000.0) {
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 (z <= (-5.5d+186)) then
tmp = (z * y) / t
else if (z <= 11200000.0d0) 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 (z <= -5.5e+186) {
tmp = (z * y) / t;
} else if (z <= 11200000.0) {
tmp = x * (1.0 - (y / t));
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.5e+186: tmp = (z * y) / t elif z <= 11200000.0: tmp = x * (1.0 - (y / t)) else: tmp = z * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.5e+186) tmp = Float64(Float64(z * y) / t); elseif (z <= 11200000.0) 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 (z <= -5.5e+186) tmp = (z * y) / t; elseif (z <= 11200000.0) tmp = x * (1.0 - (y / t)); else tmp = z * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.5e+186], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 11200000.0], 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}\;z \leq -5.5 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{elif}\;z \leq 11200000:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if z < -5.4999999999999996e186Initial program 95.1%
+-commutative95.1%
associate-/l*81.1%
fma-define81.1%
Simplified81.1%
Taylor expanded in y around -inf 75.7%
Taylor expanded in z around inf 75.7%
if -5.4999999999999996e186 < z < 1.12e7Initial program 92.7%
+-commutative92.7%
associate-/l*95.4%
fma-define95.4%
Simplified95.4%
Taylor expanded in z around 0 80.2%
mul-1-neg80.2%
*-rgt-identity80.2%
associate-/l*85.2%
distribute-rgt-neg-in85.2%
mul-1-neg85.2%
distribute-lft-in85.1%
mul-1-neg85.1%
unsub-neg85.1%
Simplified85.1%
if 1.12e7 < z Initial program 82.8%
+-commutative82.8%
associate-/l*92.5%
fma-define92.5%
Simplified92.5%
Taylor expanded in y around -inf 65.1%
associate-/l*92.5%
*-commutative92.5%
Applied egg-rr76.3%
Taylor expanded in z around inf 59.3%
associate-*l/70.6%
Simplified70.6%
Final simplification80.7%
(FPCore (x y z t) :precision binary64 (if (<= z -9.6e+186) (/ (* z y) t) (if (<= z 3700000.0) (* x (- 1.0 (/ y t))) (* y (/ (- z x) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9.6e+186) {
tmp = (z * y) / t;
} else if (z <= 3700000.0) {
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 (z <= (-9.6d+186)) then
tmp = (z * y) / t
else if (z <= 3700000.0d0) 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 (z <= -9.6e+186) {
tmp = (z * y) / t;
} else if (z <= 3700000.0) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * ((z - x) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9.6e+186: tmp = (z * y) / t elif z <= 3700000.0: tmp = x * (1.0 - (y / t)) else: tmp = y * ((z - x) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9.6e+186) tmp = Float64(Float64(z * y) / t); elseif (z <= 3700000.0) 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 (z <= -9.6e+186) tmp = (z * y) / t; elseif (z <= 3700000.0) tmp = x * (1.0 - (y / t)); else tmp = y * ((z - x) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9.6e+186], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 3700000.0], 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}\;z \leq -9.6 \cdot 10^{+186}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{elif}\;z \leq 3700000:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\end{array}
\end{array}
if z < -9.5999999999999998e186Initial program 95.1%
+-commutative95.1%
associate-/l*81.1%
fma-define81.1%
Simplified81.1%
Taylor expanded in y around -inf 75.7%
Taylor expanded in z around inf 75.7%
if -9.5999999999999998e186 < z < 3.7e6Initial program 92.7%
+-commutative92.7%
associate-/l*95.4%
fma-define95.4%
Simplified95.4%
Taylor expanded in z around 0 80.2%
mul-1-neg80.2%
*-rgt-identity80.2%
associate-/l*85.2%
distribute-rgt-neg-in85.2%
mul-1-neg85.2%
distribute-lft-in85.1%
mul-1-neg85.1%
unsub-neg85.1%
Simplified85.1%
if 3.7e6 < z Initial program 82.8%
+-commutative82.8%
associate-/l*92.5%
fma-define92.5%
Simplified92.5%
Taylor expanded in y around -inf 65.1%
associate-/l*92.5%
*-commutative92.5%
Applied egg-rr76.3%
Final simplification82.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.6e+56) (not (<= z 300000.0))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.6e+56) || !(z <= 300000.0)) {
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 <= (-5.6d+56)) .or. (.not. (z <= 300000.0d0))) 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 <= -5.6e+56) || !(z <= 300000.0)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.6e+56) or not (z <= 300000.0): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.6e+56) || !(z <= 300000.0)) 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 <= -5.6e+56) || ~((z <= 300000.0))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.6e+56], N[Not[LessEqual[z, 300000.0]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+56} \lor \neg \left(z \leq 300000\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.60000000000000017e56 or 3e5 < z Initial program 87.5%
+-commutative87.5%
associate-/l*91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in y around -inf 67.0%
Taylor expanded in z around inf 58.6%
associate-/l*64.3%
Simplified64.3%
if -5.60000000000000017e56 < z < 3e5Initial program 92.6%
+-commutative92.6%
associate-/l*95.2%
fma-define95.2%
Simplified95.2%
Taylor expanded in y around 0 48.4%
Final simplification55.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.5e+56) (not (<= z 8600.0))) (* z (/ y t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.5e+56) || !(z <= 8600.0)) {
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 ((z <= (-4.5d+56)) .or. (.not. (z <= 8600.0d0))) 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 ((z <= -4.5e+56) || !(z <= 8600.0)) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.5e+56) or not (z <= 8600.0): tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.5e+56) || !(z <= 8600.0)) 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 ((z <= -4.5e+56) || ~((z <= 8600.0))) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.5e+56], N[Not[LessEqual[z, 8600.0]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+56} \lor \neg \left(z \leq 8600\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.5000000000000003e56 or 8600 < z Initial program 87.5%
+-commutative87.5%
associate-/l*91.5%
fma-define91.5%
Simplified91.5%
Taylor expanded in y around -inf 67.0%
associate-/l*91.5%
*-commutative91.5%
Applied egg-rr71.9%
Taylor expanded in z around inf 58.6%
associate-*l/66.0%
Simplified66.0%
if -4.5000000000000003e56 < z < 8600Initial program 92.6%
+-commutative92.6%
associate-/l*95.2%
fma-define95.2%
Simplified95.2%
Taylor expanded in y around 0 48.4%
Final simplification56.2%
(FPCore (x y z t) :precision binary64 (+ x (/ (- z x) (/ t y))))
double code(double x, double y, double z, double t) {
return x + ((z - x) / (t / y));
}
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) / (t / y))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) / (t / y));
}
def code(x, y, z, t): return x + ((z - x) / (t / y))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) / Float64(t / y))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) / (t / y)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - x}{\frac{t}{y}}
\end{array}
Initial program 90.3%
+-commutative90.3%
associate-/l*93.5%
fma-define93.5%
Simplified93.5%
fma-undefine93.5%
associate-/l*90.3%
*-commutative90.3%
associate-/l*97.3%
Applied egg-rr97.3%
clear-num97.2%
un-div-inv97.5%
Applied egg-rr97.5%
Final simplification97.5%
(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 90.3%
+-commutative90.3%
associate-/l*93.5%
fma-define93.5%
Simplified93.5%
fma-undefine93.5%
associate-/l*90.3%
*-commutative90.3%
associate-/l*97.3%
Applied egg-rr97.3%
Final simplification97.3%
(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 90.3%
+-commutative90.3%
associate-/l*93.5%
fma-define93.5%
Simplified93.5%
Taylor expanded in y around 0 37.0%
Final simplification37.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 2024095
(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)))