
(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 10 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 (* y (/ (- t z) (- t a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / (t - a)));
}
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 * ((t - z) / (t - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / (t - a)));
}
def code(x, y, z, t, a): return x + (y * ((t - z) / (t - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(t - z) / Float64(t - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((t - z) / (t - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{t - z}{t - a}
\end{array}
Initial program 83.3%
associate-/l*98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.2e+64) (not (<= t 3.3e+113))) (+ x (- y (* y (/ z t)))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.2e+64) || !(t <= 3.3e+113)) {
tmp = x + (y - (y * (z / t)));
} else {
tmp = x + (y / ((a - t) / z));
}
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+64)) .or. (.not. (t <= 3.3d+113))) then
tmp = x + (y - (y * (z / t)))
else
tmp = x + (y / ((a - t) / z))
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+64) || !(t <= 3.3e+113)) {
tmp = x + (y - (y * (z / t)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.2e+64) or not (t <= 3.3e+113): tmp = x + (y - (y * (z / t))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.2e+64) || !(t <= 3.3e+113)) tmp = Float64(x + Float64(y - Float64(y * Float64(z / t)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.2e+64) || ~((t <= 3.3e+113))) tmp = x + (y - (y * (z / t))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.2e+64], N[Not[LessEqual[t, 3.3e+113]], $MachinePrecision]], N[(x + N[(y - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+64} \lor \neg \left(t \leq 3.3 \cdot 10^{+113}\right):\\
\;\;\;\;x + \left(y - y \cdot \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -5.19999999999999994e64 or 3.3000000000000003e113 < t Initial program 66.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 93.6%
associate-*r/93.6%
neg-mul-193.6%
Simplified93.6%
Taylor expanded in z around 0 85.4%
+-commutative85.4%
mul-1-neg85.4%
unsub-neg85.4%
associate-/l*93.6%
Simplified93.6%
if -5.19999999999999994e64 < t < 3.3000000000000003e113Initial program 92.8%
+-commutative92.8%
associate-/l*97.9%
fma-define97.9%
Simplified97.9%
fma-undefine97.9%
clear-num97.6%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in z around inf 88.9%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e+67) (not (<= t 9.4e+110))) (+ x (- y (* y (/ z t)))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+67) || !(t <= 9.4e+110)) {
tmp = x + (y - (y * (z / t)));
} else {
tmp = x + (y * (z / (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 <= (-2.2d+67)) .or. (.not. (t <= 9.4d+110))) then
tmp = x + (y - (y * (z / t)))
else
tmp = x + (y * (z / (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 <= -2.2e+67) || !(t <= 9.4e+110)) {
tmp = x + (y - (y * (z / t)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e+67) or not (t <= 9.4e+110): tmp = x + (y - (y * (z / t))) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e+67) || !(t <= 9.4e+110)) tmp = Float64(x + Float64(y - Float64(y * Float64(z / t)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.2e+67) || ~((t <= 9.4e+110))) tmp = x + (y - (y * (z / t))); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e+67], N[Not[LessEqual[t, 9.4e+110]], $MachinePrecision]], N[(x + N[(y - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+67} \lor \neg \left(t \leq 9.4 \cdot 10^{+110}\right):\\
\;\;\;\;x + \left(y - y \cdot \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -2.2e67 or 9.3999999999999996e110 < t Initial program 66.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 93.6%
associate-*r/93.6%
neg-mul-193.6%
Simplified93.6%
Taylor expanded in z around 0 85.4%
+-commutative85.4%
mul-1-neg85.4%
unsub-neg85.4%
associate-/l*93.6%
Simplified93.6%
if -2.2e67 < t < 9.3999999999999996e110Initial program 92.8%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in z around inf 84.8%
associate-/l*88.8%
Simplified88.8%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e+65) (not (<= t 2.1e+118))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+65) || !(t <= 2.1e+118)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (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 <= (-3.4d+65)) .or. (.not. (t <= 2.1d+118))) then
tmp = x + y
else
tmp = x + (y * (z / (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 <= -3.4e+65) || !(t <= 2.1e+118)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.4e+65) or not (t <= 2.1e+118): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e+65) || !(t <= 2.1e+118)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.4e+65) || ~((t <= 2.1e+118))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e+65], N[Not[LessEqual[t, 2.1e+118]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+65} \lor \neg \left(t \leq 2.1 \cdot 10^{+118}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -3.3999999999999999e65 or 2.1e118 < t Initial program 65.0%
+-commutative65.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 87.8%
+-commutative87.8%
Simplified87.8%
if -3.3999999999999999e65 < t < 2.1e118Initial program 93.0%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in z around inf 84.6%
associate-/l*88.5%
Simplified88.5%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.95e+54) (+ x (* y (/ t (- t a)))) (if (<= t 9e+110) (+ x (/ y (/ (- a t) z))) (+ x (- y (* y (/ z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.95e+54) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 9e+110) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (y - (y * (z / 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.95d+54)) then
tmp = x + (y * (t / (t - a)))
else if (t <= 9d+110) then
tmp = x + (y / ((a - t) / z))
else
tmp = x + (y - (y * (z / 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.95e+54) {
tmp = x + (y * (t / (t - a)));
} else if (t <= 9e+110) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x + (y - (y * (z / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.95e+54: tmp = x + (y * (t / (t - a))) elif t <= 9e+110: tmp = x + (y / ((a - t) / z)) else: tmp = x + (y - (y * (z / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.95e+54) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); elseif (t <= 9e+110) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x + Float64(y - Float64(y * Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.95e+54) tmp = x + (y * (t / (t - a))); elseif (t <= 9e+110) tmp = x + (y / ((a - t) / z)); else tmp = x + (y - (y * (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.95e+54], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e+110], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{+54}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+110}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - y \cdot \frac{z}{t}\right)\\
\end{array}
\end{array}
if t < -1.9500000000000001e54Initial program 63.8%
+-commutative63.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around 0 61.8%
mul-1-neg61.8%
unsub-neg61.8%
*-commutative61.8%
*-lft-identity61.8%
times-frac93.4%
/-rgt-identity93.4%
Simplified93.4%
if -1.9500000000000001e54 < t < 9.0000000000000005e110Initial program 92.8%
+-commutative92.8%
associate-/l*97.9%
fma-define97.9%
Simplified97.9%
fma-undefine97.9%
clear-num97.5%
un-div-inv97.6%
Applied egg-rr97.6%
Taylor expanded in z around inf 89.4%
if 9.0000000000000005e110 < t Initial program 70.9%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around 0 93.7%
associate-*r/93.7%
neg-mul-193.7%
Simplified93.7%
Taylor expanded in z around 0 91.6%
+-commutative91.6%
mul-1-neg91.6%
unsub-neg91.6%
associate-/l*93.8%
Simplified93.8%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.05e+49) (not (<= t 2.9e+60))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.05e+49) || !(t <= 2.9e+60)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
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.05d+49)) .or. (.not. (t <= 2.9d+60))) then
tmp = x + y
else
tmp = x + (y / (a / z))
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.05e+49) || !(t <= 2.9e+60)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.05e+49) or not (t <= 2.9e+60): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.05e+49) || !(t <= 2.9e+60)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.05e+49) || ~((t <= 2.9e+60))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.05e+49], N[Not[LessEqual[t, 2.9e+60]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{+49} \lor \neg \left(t \leq 2.9 \cdot 10^{+60}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.05e49 or 2.9e60 < t Initial program 68.8%
+-commutative68.8%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 80.4%
+-commutative80.4%
Simplified80.4%
if -2.05e49 < t < 2.9e60Initial program 95.1%
+-commutative95.1%
associate-/l*97.6%
fma-define97.6%
Simplified97.6%
fma-undefine97.6%
clear-num97.2%
un-div-inv97.3%
Applied egg-rr97.3%
Taylor expanded in t around 0 81.9%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.6e+48) (not (<= t 9e+110))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.6e+48) || !(t <= 9e+110)) {
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 <= (-5.6d+48)) .or. (.not. (t <= 9d+110))) 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 <= -5.6e+48) || !(t <= 9e+110)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.6e+48) or not (t <= 9e+110): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.6e+48) || !(t <= 9e+110)) 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 <= -5.6e+48) || ~((t <= 9e+110))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.6e+48], N[Not[LessEqual[t, 9e+110]], $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 -5.6 \cdot 10^{+48} \lor \neg \left(t \leq 9 \cdot 10^{+110}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -5.60000000000000025e48 or 9.0000000000000005e110 < t Initial program 67.5%
+-commutative67.5%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 85.6%
+-commutative85.6%
Simplified85.6%
if -5.60000000000000025e48 < t < 9.0000000000000005e110Initial program 92.7%
+-commutative92.7%
associate-/l*97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in t around 0 73.2%
+-commutative73.2%
associate-/l*78.5%
Simplified78.5%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1e+39) (not (<= t 1.62))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e+39) || !(t <= 1.62)) {
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 <= (-1d+39)) .or. (.not. (t <= 1.62d0))) 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 <= -1e+39) || !(t <= 1.62)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1e+39) or not (t <= 1.62): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1e+39) || !(t <= 1.62)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1e+39) || ~((t <= 1.62))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1e+39], N[Not[LessEqual[t, 1.62]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+39} \lor \neg \left(t \leq 1.62\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -9.9999999999999994e38 or 1.6200000000000001 < t Initial program 71.3%
+-commutative71.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 79.7%
+-commutative79.7%
Simplified79.7%
if -9.9999999999999994e38 < t < 1.6200000000000001Initial program 96.7%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in t around 0 79.7%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e+48) (not (<= t 7.8e-5))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e+48) || !(t <= 7.8e-5)) {
tmp = x + 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 ((t <= (-9d+48)) .or. (.not. (t <= 7.8d-5))) then
tmp = x + 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 ((t <= -9e+48) || !(t <= 7.8e-5)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e+48) or not (t <= 7.8e-5): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e+48) || !(t <= 7.8e-5)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9e+48) || ~((t <= 7.8e-5))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e+48], N[Not[LessEqual[t, 7.8e-5]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+48} \lor \neg \left(t \leq 7.8 \cdot 10^{-5}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -8.99999999999999991e48 or 7.7999999999999999e-5 < t Initial program 72.1%
+-commutative72.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 80.0%
+-commutative80.0%
Simplified80.0%
if -8.99999999999999991e48 < t < 7.7999999999999999e-5Initial program 95.2%
+-commutative95.2%
associate-/l*97.3%
fma-define97.3%
Simplified97.3%
Taylor expanded in y around 0 56.5%
Final simplification68.6%
(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 83.3%
+-commutative83.3%
associate-/l*98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in y around 0 51.1%
(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 2024163
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))