
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (- z t) (/ (- a t) y))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / ((a - t) / y));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((z - t) / ((a - t) / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / ((a - t) / y));
}
def code(x, y, z, t, a): return x + ((z - t) / ((a - t) / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) / Float64(Float64(a - t) / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) / ((a - t) / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{\frac{a - t}{y}}
\end{array}
Initial program 85.7%
*-commutative85.7%
associate-/l*98.2%
Simplified98.2%
Final simplification98.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- z t) y) (- a t))))
(if (<= t_1 (- INFINITY))
(- x (/ y (/ t (- z t))))
(if (<= t_1 1e+298) (+ x t_1) (* y (/ (- z t) (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (a - t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x - (y / (t / (z - t)));
} else if (t_1 <= 1e+298) {
tmp = x + t_1;
} else {
tmp = y * ((z - t) / (a - t));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (a - t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x - (y / (t / (z - t)));
} else if (t_1 <= 1e+298) {
tmp = x + t_1;
} else {
tmp = y * ((z - t) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) * y) / (a - t) tmp = 0 if t_1 <= -math.inf: tmp = x - (y / (t / (z - t))) elif t_1 <= 1e+298: tmp = x + t_1 else: tmp = y * ((z - t) / (a - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) * y) / Float64(a - t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); elseif (t_1 <= 1e+298) tmp = Float64(x + t_1); else tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) * y) / (a - t); tmp = 0.0; if (t_1 <= -Inf) tmp = x - (y / (t / (z - t))); elseif (t_1 <= 1e+298) tmp = x + t_1; else tmp = y * ((z - t) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+298], N[(x + t$95$1), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{elif}\;t_1 \leq 10^{+298}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0Initial program 33.6%
Taylor expanded in a around 0 33.1%
mul-1-neg33.1%
*-commutative33.1%
associate-/l*77.6%
Simplified77.6%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 9.9999999999999996e297Initial program 99.8%
if 9.9999999999999996e297 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 24.3%
+-commutative24.3%
associate-*l/99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around 0 24.3%
associate-*l/77.6%
Applied egg-rr77.6%
Final simplification95.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.6e+22)
(+ x y)
(if (<= t -4.6e-27)
(+ x (* y (/ z a)))
(if (<= t -8.2e-50)
(+ x y)
(if (<= t 6.5e+29) (+ x (/ z (/ a y))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.6e+22) {
tmp = x + y;
} else if (t <= -4.6e-27) {
tmp = x + (y * (z / a));
} else if (t <= -8.2e-50) {
tmp = x + y;
} else if (t <= 6.5e+29) {
tmp = x + (z / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2.6d+22)) then
tmp = x + y
else if (t <= (-4.6d-27)) then
tmp = x + (y * (z / a))
else if (t <= (-8.2d-50)) then
tmp = x + y
else if (t <= 6.5d+29) then
tmp = x + (z / (a / y))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.6e+22) {
tmp = x + y;
} else if (t <= -4.6e-27) {
tmp = x + (y * (z / a));
} else if (t <= -8.2e-50) {
tmp = x + y;
} else if (t <= 6.5e+29) {
tmp = x + (z / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.6e+22: tmp = x + y elif t <= -4.6e-27: tmp = x + (y * (z / a)) elif t <= -8.2e-50: tmp = x + y elif t <= 6.5e+29: tmp = x + (z / (a / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.6e+22) tmp = Float64(x + y); elseif (t <= -4.6e-27) tmp = Float64(x + Float64(y * Float64(z / a))); elseif (t <= -8.2e-50) tmp = Float64(x + y); elseif (t <= 6.5e+29) tmp = Float64(x + Float64(z / Float64(a / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.6e+22) tmp = x + y; elseif (t <= -4.6e-27) tmp = x + (y * (z / a)); elseif (t <= -8.2e-50) tmp = x + y; elseif (t <= 6.5e+29) tmp = x + (z / (a / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.6e+22], N[(x + y), $MachinePrecision], If[LessEqual[t, -4.6e-27], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8.2e-50], N[(x + y), $MachinePrecision], If[LessEqual[t, 6.5e+29], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+22}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{-27}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{-50}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+29}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -2.6e22 or -4.5999999999999999e-27 < t < -8.19999999999999971e-50 or 6.49999999999999971e29 < t Initial program 74.9%
Taylor expanded in t around inf 79.2%
if -2.6e22 < t < -4.5999999999999999e-27Initial program 100.0%
Taylor expanded in t around 0 96.2%
*-commutative96.2%
associate-/l*78.7%
associate-/r/96.2%
Applied egg-rr96.2%
if -8.19999999999999971e-50 < t < 6.49999999999999971e29Initial program 95.2%
Taylor expanded in t around 0 80.7%
*-commutative80.7%
associate-/l*84.7%
add-cube-cbrt84.4%
*-un-lft-identity84.4%
times-frac84.4%
pow284.4%
Applied egg-rr84.4%
/-rgt-identity84.4%
associate-*r/84.4%
unpow284.4%
rem-3cbrt-lft84.7%
Simplified84.7%
Final simplification82.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.5e+94)
(+ x y)
(if (<= t -2.3e-39)
(- x (* z (/ y t)))
(if (<= t -3.5e-49)
(+ x y)
(if (<= t 4.6e+29) (+ x (/ z (/ a y))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e+94) {
tmp = x + y;
} else if (t <= -2.3e-39) {
tmp = x - (z * (y / t));
} else if (t <= -3.5e-49) {
tmp = x + y;
} else if (t <= 4.6e+29) {
tmp = x + (z / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.5d+94)) then
tmp = x + y
else if (t <= (-2.3d-39)) then
tmp = x - (z * (y / t))
else if (t <= (-3.5d-49)) then
tmp = x + y
else if (t <= 4.6d+29) then
tmp = x + (z / (a / y))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e+94) {
tmp = x + y;
} else if (t <= -2.3e-39) {
tmp = x - (z * (y / t));
} else if (t <= -3.5e-49) {
tmp = x + y;
} else if (t <= 4.6e+29) {
tmp = x + (z / (a / y));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.5e+94: tmp = x + y elif t <= -2.3e-39: tmp = x - (z * (y / t)) elif t <= -3.5e-49: tmp = x + y elif t <= 4.6e+29: tmp = x + (z / (a / y)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.5e+94) tmp = Float64(x + y); elseif (t <= -2.3e-39) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t <= -3.5e-49) tmp = Float64(x + y); elseif (t <= 4.6e+29) tmp = Float64(x + Float64(z / Float64(a / y))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.5e+94) tmp = x + y; elseif (t <= -2.3e-39) tmp = x - (z * (y / t)); elseif (t <= -3.5e-49) tmp = x + y; elseif (t <= 4.6e+29) tmp = x + (z / (a / y)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.5e+94], N[(x + y), $MachinePrecision], If[LessEqual[t, -2.3e-39], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.5e-49], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.6e+29], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+94}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-39}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{-49}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{+29}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.5e94 or -2.30000000000000008e-39 < t < -3.50000000000000006e-49 or 4.6000000000000002e29 < t Initial program 68.5%
Taylor expanded in t around inf 85.3%
if -1.5e94 < t < -2.30000000000000008e-39Initial program 99.8%
Taylor expanded in z around inf 75.3%
associate-*l/73.4%
*-commutative73.4%
Simplified73.4%
Taylor expanded in a around 0 70.0%
+-commutative70.0%
mul-1-neg70.0%
unsub-neg70.0%
*-commutative70.0%
associate-/l*70.0%
Simplified70.0%
clear-num69.9%
associate-/r/70.0%
clear-num70.0%
Applied egg-rr70.0%
if -3.50000000000000006e-49 < t < 4.6000000000000002e29Initial program 95.2%
Taylor expanded in t around 0 80.7%
*-commutative80.7%
associate-/l*84.7%
add-cube-cbrt84.4%
*-un-lft-identity84.4%
times-frac84.4%
pow284.4%
Applied egg-rr84.4%
/-rgt-identity84.4%
associate-*r/84.4%
unpow284.4%
rem-3cbrt-lft84.7%
Simplified84.7%
Final simplification82.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -8.5e-84)
(+ x y)
(if (<= t 3.4e-190)
x
(if (<= t 4e-122) (* y (/ z (- a t))) (if (<= t 7.2e+22) x (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.5e-84) {
tmp = x + y;
} else if (t <= 3.4e-190) {
tmp = x;
} else if (t <= 4e-122) {
tmp = y * (z / (a - t));
} else if (t <= 7.2e+22) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-8.5d-84)) then
tmp = x + y
else if (t <= 3.4d-190) then
tmp = x
else if (t <= 4d-122) then
tmp = y * (z / (a - t))
else if (t <= 7.2d+22) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.5e-84) {
tmp = x + y;
} else if (t <= 3.4e-190) {
tmp = x;
} else if (t <= 4e-122) {
tmp = y * (z / (a - t));
} else if (t <= 7.2e+22) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.5e-84: tmp = x + y elif t <= 3.4e-190: tmp = x elif t <= 4e-122: tmp = y * (z / (a - t)) elif t <= 7.2e+22: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.5e-84) tmp = Float64(x + y); elseif (t <= 3.4e-190) tmp = x; elseif (t <= 4e-122) tmp = Float64(y * Float64(z / Float64(a - t))); elseif (t <= 7.2e+22) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.5e-84) tmp = x + y; elseif (t <= 3.4e-190) tmp = x; elseif (t <= 4e-122) tmp = y * (z / (a - t)); elseif (t <= 7.2e+22) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.5e-84], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.4e-190], x, If[LessEqual[t, 4e-122], N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+22], x, N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-84}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-190}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-122}:\\
\;\;\;\;y \cdot \frac{z}{a - t}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+22}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -8.4999999999999994e-84 or 7.2e22 < t Initial program 78.2%
Taylor expanded in t around inf 76.1%
if -8.4999999999999994e-84 < t < 3.39999999999999981e-190 or 4.00000000000000024e-122 < t < 7.2e22Initial program 96.3%
Taylor expanded in x around inf 63.9%
if 3.39999999999999981e-190 < t < 4.00000000000000024e-122Initial program 79.4%
+-commutative79.4%
associate-*l/89.7%
fma-def89.7%
Simplified89.7%
Taylor expanded in x around 0 68.9%
associate-*l/78.7%
Applied egg-rr78.7%
Taylor expanded in z around inf 68.7%
*-commutative68.7%
associate-/l*88.8%
associate-/r/78.5%
Simplified78.5%
Final simplification71.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.8e+94) (not (<= t 8e+30))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e+94) || !(t <= 8e+30)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.8d+94)) .or. (.not. (t <= 8d+30))) then
tmp = x + y
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e+94) || !(t <= 8e+30)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.8e+94) or not (t <= 8e+30): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.8e+94) || !(t <= 8e+30)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.8e+94) || ~((t <= 8e+30))) tmp = x + y; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.8e+94], N[Not[LessEqual[t, 8e+30]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+94} \lor \neg \left(t \leq 8 \cdot 10^{+30}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.79999999999999996e94 or 8.0000000000000002e30 < t Initial program 66.4%
Taylor expanded in t around inf 84.3%
if -1.79999999999999996e94 < t < 8.0000000000000002e30Initial program 96.4%
Taylor expanded in z around inf 86.2%
associate-*l/88.1%
*-commutative88.1%
Simplified88.1%
Final simplification86.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e+20) (not (<= z 185.0))) (+ x (* z (/ y (- a t)))) (- x (/ y (+ (/ a t) -1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+20) || !(z <= 185.0)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y / ((a / t) + -1.0));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.6d+20)) .or. (.not. (z <= 185.0d0))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x - (y / ((a / t) + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+20) || !(z <= 185.0)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y / ((a / t) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e+20) or not (z <= 185.0): tmp = x + (z * (y / (a - t))) else: tmp = x - (y / ((a / t) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e+20) || !(z <= 185.0)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.6e+20) || ~((z <= 185.0))) tmp = x + (z * (y / (a - t))); else tmp = x - (y / ((a / t) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e+20], N[Not[LessEqual[z, 185.0]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+20} \lor \neg \left(z \leq 185\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\end{array}
\end{array}
if z < -2.6e20 or 185 < z Initial program 82.4%
Taylor expanded in z around inf 83.4%
associate-*l/91.9%
*-commutative91.9%
Simplified91.9%
if -2.6e20 < z < 185Initial program 88.0%
+-commutative88.0%
associate-*l/96.9%
fma-def96.9%
Simplified96.9%
fma-udef96.9%
associate-*l/88.0%
associate-/l*99.3%
div-inv99.3%
clear-num99.3%
Applied egg-rr99.3%
Taylor expanded in z around 0 79.9%
+-commutative79.9%
mul-1-neg79.9%
unsub-neg79.9%
associate-/l*91.2%
Simplified91.2%
Taylor expanded in a around 0 91.2%
Final simplification91.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -6.7e-84)
(+ x y)
(if (<= t 7.8e-191)
x
(if (<= t 4e-122) (* y (/ z a)) (if (<= t 1.7e+23) x (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.7e-84) {
tmp = x + y;
} else if (t <= 7.8e-191) {
tmp = x;
} else if (t <= 4e-122) {
tmp = y * (z / a);
} else if (t <= 1.7e+23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-6.7d-84)) then
tmp = x + y
else if (t <= 7.8d-191) then
tmp = x
else if (t <= 4d-122) then
tmp = y * (z / a)
else if (t <= 1.7d+23) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.7e-84) {
tmp = x + y;
} else if (t <= 7.8e-191) {
tmp = x;
} else if (t <= 4e-122) {
tmp = y * (z / a);
} else if (t <= 1.7e+23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.7e-84: tmp = x + y elif t <= 7.8e-191: tmp = x elif t <= 4e-122: tmp = y * (z / a) elif t <= 1.7e+23: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.7e-84) tmp = Float64(x + y); elseif (t <= 7.8e-191) tmp = x; elseif (t <= 4e-122) tmp = Float64(y * Float64(z / a)); elseif (t <= 1.7e+23) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.7e-84) tmp = x + y; elseif (t <= 7.8e-191) tmp = x; elseif (t <= 4e-122) tmp = y * (z / a); elseif (t <= 1.7e+23) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.7e-84], N[(x + y), $MachinePrecision], If[LessEqual[t, 7.8e-191], x, If[LessEqual[t, 4e-122], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e+23], x, N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.7 \cdot 10^{-84}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{-191}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-122}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -6.7e-84 or 1.69999999999999996e23 < t Initial program 78.2%
Taylor expanded in t around inf 76.1%
if -6.7e-84 < t < 7.7999999999999999e-191 or 4.00000000000000024e-122 < t < 1.69999999999999996e23Initial program 96.3%
Taylor expanded in x around inf 63.9%
if 7.7999999999999999e-191 < t < 4.00000000000000024e-122Initial program 79.4%
+-commutative79.4%
associate-*l/89.7%
fma-def89.7%
Simplified89.7%
Taylor expanded in x around 0 68.9%
associate-*l/78.7%
Applied egg-rr78.7%
Taylor expanded in t around 0 67.6%
Final simplification70.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.8e+25) (not (<= t 3.8e+30))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e+25) || !(t <= 3.8e+30)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.8d+25)) .or. (.not. (t <= 3.8d+30))) then
tmp = x + y
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e+25) || !(t <= 3.8e+30)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.8e+25) or not (t <= 3.8e+30): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.8e+25) || !(t <= 3.8e+30)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.8e+25) || ~((t <= 3.8e+30))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.8e+25], N[Not[LessEqual[t, 3.8e+30]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+25} \lor \neg \left(t \leq 3.8 \cdot 10^{+30}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.80000000000000008e25 or 3.8000000000000001e30 < t Initial program 73.1%
Taylor expanded in t around inf 79.5%
if -1.80000000000000008e25 < t < 3.8000000000000001e30Initial program 95.9%
Taylor expanded in t around 0 80.3%
*-commutative80.3%
associate-/l*82.3%
associate-/r/81.4%
Applied egg-rr81.4%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.5e+21) (+ x y) (if (<= t 1.7e+31) (+ x (/ y (/ a z))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e+21) {
tmp = x + y;
} else if (t <= 1.7e+31) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-4.5d+21)) then
tmp = x + y
else if (t <= 1.7d+31) then
tmp = x + (y / (a / z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e+21) {
tmp = x + y;
} else if (t <= 1.7e+31) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.5e+21: tmp = x + y elif t <= 1.7e+31: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.5e+21) tmp = Float64(x + y); elseif (t <= 1.7e+31) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.5e+21) tmp = x + y; elseif (t <= 1.7e+31) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.5e+21], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.7e+31], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+21}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+31}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.5e21 or 1.6999999999999999e31 < t Initial program 73.1%
Taylor expanded in t around inf 79.5%
if -4.5e21 < t < 1.6999999999999999e31Initial program 95.9%
Taylor expanded in t around 0 80.3%
associate-/l*81.9%
Simplified81.9%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.2e-84) (+ x y) (if (<= t 2.9e+23) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.2e-84) {
tmp = x + y;
} else if (t <= 2.9e+23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-5.2d-84)) then
tmp = x + y
else if (t <= 2.9d+23) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.2e-84) {
tmp = x + y;
} else if (t <= 2.9e+23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.2e-84: tmp = x + y elif t <= 2.9e+23: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.2e-84) tmp = Float64(x + y); elseif (t <= 2.9e+23) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.2e-84) tmp = x + y; elseif (t <= 2.9e+23) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.2e-84], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.9e+23], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-84}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -5.2e-84 or 2.90000000000000013e23 < t Initial program 78.2%
Taylor expanded in t around inf 76.1%
if -5.2e-84 < t < 2.90000000000000013e23Initial program 94.9%
Taylor expanded in x around inf 60.0%
Final simplification68.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.12e-251) x (if (<= x 4.2e-288) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.12e-251) {
tmp = x;
} else if (x <= 4.2e-288) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-1.12d-251)) then
tmp = x
else if (x <= 4.2d-288) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.12e-251) {
tmp = x;
} else if (x <= 4.2e-288) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.12e-251: tmp = x elif x <= 4.2e-288: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.12e-251) tmp = x; elseif (x <= 4.2e-288) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.12e-251) tmp = x; elseif (x <= 4.2e-288) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.12e-251], x, If[LessEqual[x, 4.2e-288], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{-251}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-288}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.12000000000000007e-251 or 4.19999999999999991e-288 < x Initial program 87.1%
Taylor expanded in x around inf 62.8%
if -1.12000000000000007e-251 < x < 4.19999999999999991e-288Initial program 73.3%
+-commutative73.3%
associate-*l/93.4%
fma-def93.4%
Simplified93.4%
Taylor expanded in x around 0 62.8%
Taylor expanded in z around 0 31.4%
mul-1-neg31.4%
distribute-rgt-neg-out31.4%
Simplified31.4%
Taylor expanded in t around inf 54.1%
Final simplification61.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 85.7%
Taylor expanded in x around inf 57.8%
Final simplification57.8%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2023279
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))