
(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 11 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 (/ (- 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}
Initial program 85.3%
associate-/l*99.0%
Simplified99.0%
clear-num98.7%
un-div-inv99.1%
Applied egg-rr99.1%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1e-35)
(- x (* y (/ (- t z) a)))
(if (<= a 6e-55)
(+ x (* y (- 1.0 (/ z t))))
(if (<= a 5.4e+84) (+ x (/ (* y z) (- a t))) (+ x (/ y (/ a (- z t))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1e-35) {
tmp = x - (y * ((t - z) / a));
} else if (a <= 6e-55) {
tmp = x + (y * (1.0 - (z / t)));
} else if (a <= 5.4e+84) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y / (a / (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 (a <= (-1d-35)) then
tmp = x - (y * ((t - z) / a))
else if (a <= 6d-55) then
tmp = x + (y * (1.0d0 - (z / t)))
else if (a <= 5.4d+84) then
tmp = x + ((y * z) / (a - t))
else
tmp = x + (y / (a / (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 (a <= -1e-35) {
tmp = x - (y * ((t - z) / a));
} else if (a <= 6e-55) {
tmp = x + (y * (1.0 - (z / t)));
} else if (a <= 5.4e+84) {
tmp = x + ((y * z) / (a - t));
} else {
tmp = x + (y / (a / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1e-35: tmp = x - (y * ((t - z) / a)) elif a <= 6e-55: tmp = x + (y * (1.0 - (z / t))) elif a <= 5.4e+84: tmp = x + ((y * z) / (a - t)) else: tmp = x + (y / (a / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1e-35) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / a))); elseif (a <= 6e-55) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); elseif (a <= 5.4e+84) tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); else tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1e-35) tmp = x - (y * ((t - z) / a)); elseif (a <= 6e-55) tmp = x + (y * (1.0 - (z / t))); elseif (a <= 5.4e+84) tmp = x + ((y * z) / (a - t)); else tmp = x + (y / (a / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1e-35], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e-55], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.4e+84], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{-35}:\\
\;\;\;\;x - y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-55}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{elif}\;a \leq 5.4 \cdot 10^{+84}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\end{array}
\end{array}
if a < -1.00000000000000001e-35Initial program 87.5%
+-commutative87.5%
*-commutative87.5%
associate-/l*98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in a around inf 83.4%
+-commutative83.4%
associate-/l*92.9%
Simplified92.9%
if -1.00000000000000001e-35 < a < 6.00000000000000033e-55Initial program 87.0%
+-commutative87.0%
*-commutative87.0%
associate-/l*95.7%
fma-define95.7%
Simplified95.7%
Taylor expanded in a around 0 71.8%
mul-1-neg71.8%
unsub-neg71.8%
associate-/l*83.9%
div-sub83.9%
sub-neg83.9%
*-inverses83.9%
metadata-eval83.9%
Simplified83.9%
if 6.00000000000000033e-55 < a < 5.4e84Initial program 88.8%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around inf 84.7%
if 5.4e84 < a Initial program 73.4%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 96.0%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.25e-161) (not (<= t 8e-45))) (+ x (* y (/ t (- t a)))) (- x (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.25e-161) || !(t <= 8e-45)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x - (y * (z / (t - 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.25d-161)) .or. (.not. (t <= 8d-45))) then
tmp = x + (y * (t / (t - a)))
else
tmp = x - (y * (z / (t - 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.25e-161) || !(t <= 8e-45)) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x - (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.25e-161) or not (t <= 8e-45): tmp = x + (y * (t / (t - a))) else: tmp = x - (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.25e-161) || !(t <= 8e-45)) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.25e-161) || ~((t <= 8e-45))) tmp = x + (y * (t / (t - a))); else tmp = x - (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.25e-161], N[Not[LessEqual[t, 8e-45]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{-161} \lor \neg \left(t \leq 8 \cdot 10^{-45}\right):\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if t < -1.25e-161 or 7.99999999999999987e-45 < t Initial program 80.1%
+-commutative80.1%
*-commutative80.1%
associate-/l*97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in z around 0 72.9%
mul-1-neg72.9%
unsub-neg72.9%
*-commutative72.9%
*-lft-identity72.9%
times-frac88.0%
/-rgt-identity88.0%
Simplified88.0%
if -1.25e-161 < t < 7.99999999999999987e-45Initial program 94.1%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in z around inf 87.1%
associate-/l*91.9%
Simplified91.9%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e+196) (not (<= t 6.2e+83))) (+ x y) (- x (* y (/ z (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+196) || !(t <= 6.2e+83)) {
tmp = x + y;
} else {
tmp = x - (y * (z / (t - 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 <= (-3.4d+196)) .or. (.not. (t <= 6.2d+83))) then
tmp = x + y
else
tmp = x - (y * (z / (t - 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 <= -3.4e+196) || !(t <= 6.2e+83)) {
tmp = x + y;
} else {
tmp = x - (y * (z / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.4e+196) or not (t <= 6.2e+83): tmp = x + y else: tmp = x - (y * (z / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e+196) || !(t <= 6.2e+83)) tmp = Float64(x + y); else tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.4e+196) || ~((t <= 6.2e+83))) tmp = x + y; else tmp = x - (y * (z / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e+196], N[Not[LessEqual[t, 6.2e+83]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+196} \lor \neg \left(t \leq 6.2 \cdot 10^{+83}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\end{array}
\end{array}
if t < -3.4e196 or 6.19999999999999984e83 < t Initial program 67.0%
+-commutative67.0%
*-commutative67.0%
associate-/l*95.8%
fma-define95.8%
Simplified95.8%
Taylor expanded in t around inf 92.0%
+-commutative92.0%
Simplified92.0%
if -3.4e196 < t < 6.19999999999999984e83Initial program 91.3%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in z around inf 78.4%
associate-/l*82.7%
Simplified82.7%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.4e+196) (+ x y) (if (<= t 5.4e-15) (- x (* y (/ z (- t a)))) (- x (/ y (- -1.0 (/ z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.4e+196) {
tmp = x + y;
} else if (t <= 5.4e-15) {
tmp = x - (y * (z / (t - a)));
} else {
tmp = x - (y / (-1.0 - (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 <= (-3.4d+196)) then
tmp = x + y
else if (t <= 5.4d-15) then
tmp = x - (y * (z / (t - a)))
else
tmp = x - (y / ((-1.0d0) - (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 <= -3.4e+196) {
tmp = x + y;
} else if (t <= 5.4e-15) {
tmp = x - (y * (z / (t - a)));
} else {
tmp = x - (y / (-1.0 - (z / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.4e+196: tmp = x + y elif t <= 5.4e-15: tmp = x - (y * (z / (t - a))) else: tmp = x - (y / (-1.0 - (z / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.4e+196) tmp = Float64(x + y); elseif (t <= 5.4e-15) tmp = Float64(x - Float64(y * Float64(z / Float64(t - a)))); else tmp = Float64(x - Float64(y / Float64(-1.0 - Float64(z / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.4e+196) tmp = x + y; elseif (t <= 5.4e-15) tmp = x - (y * (z / (t - a))); else tmp = x - (y / (-1.0 - (z / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.4e+196], N[(x + y), $MachinePrecision], If[LessEqual[t, 5.4e-15], N[(x - N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(-1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+196}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-15}:\\
\;\;\;\;x - y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{-1 - \frac{z}{t}}\\
\end{array}
\end{array}
if t < -3.4e196Initial program 77.2%
+-commutative77.2%
*-commutative77.2%
associate-/l*95.7%
fma-define95.7%
Simplified95.7%
Taylor expanded in t around inf 95.6%
+-commutative95.6%
Simplified95.6%
if -3.4e196 < t < 5.40000000000000018e-15Initial program 92.4%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in z around inf 81.0%
associate-/l*84.7%
Simplified84.7%
if 5.40000000000000018e-15 < t Initial program 68.2%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 85.0%
neg-mul-185.0%
distribute-neg-frac85.0%
Simplified85.0%
Taylor expanded in t around inf 83.6%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.3e-20) (not (<= t 1.3e-44))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.3e-20) || !(t <= 1.3e-44)) {
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 <= (-4.3d-20)) .or. (.not. (t <= 1.3d-44))) 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 <= -4.3e-20) || !(t <= 1.3e-44)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.3e-20) or not (t <= 1.3e-44): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.3e-20) || !(t <= 1.3e-44)) 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 <= -4.3e-20) || ~((t <= 1.3e-44))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.3e-20], N[Not[LessEqual[t, 1.3e-44]], $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 -4.3 \cdot 10^{-20} \lor \neg \left(t \leq 1.3 \cdot 10^{-44}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.30000000000000011e-20 or 1.2999999999999999e-44 < t Initial program 76.1%
+-commutative76.1%
*-commutative76.1%
associate-/l*97.2%
fma-define97.2%
Simplified97.2%
Taylor expanded in t around inf 79.1%
+-commutative79.1%
Simplified79.1%
if -4.30000000000000011e-20 < t < 1.2999999999999999e-44Initial program 95.4%
+-commutative95.4%
*-commutative95.4%
associate-/l*97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in t around 0 79.5%
+-commutative79.5%
associate-/l*83.2%
Simplified83.2%
clear-num83.1%
un-div-inv84.0%
Applied egg-rr84.0%
Final simplification81.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.8e-27) (not (<= t 1.65e-44))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.8e-27) || !(t <= 1.65e-44)) {
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 <= (-9.8d-27)) .or. (.not. (t <= 1.65d-44))) 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 <= -9.8e-27) || !(t <= 1.65e-44)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.8e-27) or not (t <= 1.65e-44): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.8e-27) || !(t <= 1.65e-44)) 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 <= -9.8e-27) || ~((t <= 1.65e-44))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.8e-27], N[Not[LessEqual[t, 1.65e-44]], $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 -9.8 \cdot 10^{-27} \lor \neg \left(t \leq 1.65 \cdot 10^{-44}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -9.79999999999999952e-27 or 1.65000000000000003e-44 < t Initial program 76.1%
+-commutative76.1%
*-commutative76.1%
associate-/l*97.2%
fma-define97.2%
Simplified97.2%
Taylor expanded in t around inf 79.1%
+-commutative79.1%
Simplified79.1%
if -9.79999999999999952e-27 < t < 1.65000000000000003e-44Initial program 95.4%
+-commutative95.4%
*-commutative95.4%
associate-/l*97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in t around 0 79.5%
+-commutative79.5%
associate-/l*83.2%
Simplified83.2%
Final simplification81.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -54.0) (not (<= t 5.5e-16))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -54.0) || !(t <= 5.5e-16)) {
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 <= (-54.0d0)) .or. (.not. (t <= 5.5d-16))) 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 <= -54.0) || !(t <= 5.5e-16)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -54.0) or not (t <= 5.5e-16): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -54.0) || !(t <= 5.5e-16)) 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 <= -54.0) || ~((t <= 5.5e-16))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -54.0], N[Not[LessEqual[t, 5.5e-16]], $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 -54 \lor \neg \left(t \leq 5.5 \cdot 10^{-16}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -54 or 5.49999999999999964e-16 < t Initial program 74.2%
+-commutative74.2%
*-commutative74.2%
associate-/l*97.0%
fma-define97.0%
Simplified97.0%
Taylor expanded in t around inf 79.0%
+-commutative79.0%
Simplified79.0%
if -54 < t < 5.49999999999999964e-16Initial program 95.7%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in t around 0 79.5%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -9e-23) x (if (<= a 1.75e+82) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9e-23) {
tmp = x;
} else if (a <= 1.75e+82) {
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 (a <= (-9d-23)) then
tmp = x
else if (a <= 1.75d+82) 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 (a <= -9e-23) {
tmp = x;
} else if (a <= 1.75e+82) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9e-23: tmp = x elif a <= 1.75e+82: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9e-23) tmp = x; elseif (a <= 1.75e+82) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9e-23) tmp = x; elseif (a <= 1.75e+82) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9e-23], x, If[LessEqual[a, 1.75e+82], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{+82}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.9999999999999995e-23 or 1.75e82 < a Initial program 83.2%
+-commutative83.2%
*-commutative83.2%
associate-/l*99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in y around 0 68.6%
if -8.9999999999999995e-23 < a < 1.75e82Initial program 86.9%
+-commutative86.9%
*-commutative86.9%
associate-/l*96.1%
fma-define96.1%
Simplified96.1%
Taylor expanded in t around inf 65.9%
+-commutative65.9%
Simplified65.9%
Final simplification67.1%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 85.3%
associate-/l*99.0%
Simplified99.0%
(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.3%
+-commutative85.3%
*-commutative85.3%
associate-/l*97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in y around 0 53.6%
(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 2024170
(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))))