
(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (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) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{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) y) (- a t))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (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) * y) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
def code(x, y, z, t, a): return (x + y) - (((z - t) * y) / (a - t))
function code(x, y, z, t, a) return Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = (x + y) - (((z - t) * y) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2e+95) (not (<= t 3.2e+67))) (+ (- x (* a (/ y t))) (* y (/ z t))) (+ (+ x y) (/ (* y (- z t)) (- t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2e+95) || !(t <= 3.2e+67)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) + ((y * (z - t)) / (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 <= (-2d+95)) .or. (.not. (t <= 3.2d+67))) then
tmp = (x - (a * (y / t))) + (y * (z / t))
else
tmp = (x + y) + ((y * (z - t)) / (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 <= -2e+95) || !(t <= 3.2e+67)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) + ((y * (z - t)) / (t - a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2e+95) or not (t <= 3.2e+67): tmp = (x - (a * (y / t))) + (y * (z / t)) else: tmp = (x + y) + ((y * (z - t)) / (t - a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2e+95) || !(t <= 3.2e+67)) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / t))); else tmp = Float64(Float64(x + y) + Float64(Float64(y * Float64(z - t)) / Float64(t - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2e+95) || ~((t <= 3.2e+67))) tmp = (x - (a * (y / t))) + (y * (z / t)); else tmp = (x + y) + ((y * (z - t)) / (t - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2e+95], N[Not[LessEqual[t, 3.2e+67]], $MachinePrecision]], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+95} \lor \neg \left(t \leq 3.2 \cdot 10^{+67}\right):\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \frac{y \cdot \left(z - t\right)}{t - a}\\
\end{array}
\end{array}
if t < -2.00000000000000004e95 or 3.19999999999999983e67 < t Initial program 52.5%
Taylor expanded in t around inf 78.3%
sub-neg78.3%
mul-1-neg78.3%
unsub-neg78.3%
associate-/l*87.6%
mul-1-neg87.6%
remove-double-neg87.6%
associate-/l*93.7%
Simplified93.7%
if -2.00000000000000004e95 < t < 3.19999999999999983e67Initial program 93.8%
Final simplification93.8%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -7.6e+54)
(and (not (<= z 3.8e+61)) (or (<= z 1.2e+81) (not (<= z 8.4e+175)))))
(* y (/ z (- t a)))
(+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.6e+54) || (!(z <= 3.8e+61) && ((z <= 1.2e+81) || !(z <= 8.4e+175)))) {
tmp = y * (z / (t - a));
} 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 ((z <= (-7.6d+54)) .or. (.not. (z <= 3.8d+61)) .and. (z <= 1.2d+81) .or. (.not. (z <= 8.4d+175))) then
tmp = y * (z / (t - a))
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 ((z <= -7.6e+54) || (!(z <= 3.8e+61) && ((z <= 1.2e+81) || !(z <= 8.4e+175)))) {
tmp = y * (z / (t - a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.6e+54) or (not (z <= 3.8e+61) and ((z <= 1.2e+81) or not (z <= 8.4e+175))): tmp = y * (z / (t - a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.6e+54) || (!(z <= 3.8e+61) && ((z <= 1.2e+81) || !(z <= 8.4e+175)))) tmp = Float64(y * Float64(z / Float64(t - a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.6e+54) || (~((z <= 3.8e+61)) && ((z <= 1.2e+81) || ~((z <= 8.4e+175))))) tmp = y * (z / (t - a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.6e+54], And[N[Not[LessEqual[z, 3.8e+61]], $MachinePrecision], Or[LessEqual[z, 1.2e+81], N[Not[LessEqual[z, 8.4e+175]], $MachinePrecision]]]], N[(y * N[(z / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+54} \lor \neg \left(z \leq 3.8 \cdot 10^{+61}\right) \land \left(z \leq 1.2 \cdot 10^{+81} \lor \neg \left(z \leq 8.4 \cdot 10^{+175}\right)\right):\\
\;\;\;\;y \cdot \frac{z}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -7.6000000000000005e54 or 3.79999999999999995e61 < z < 1.19999999999999995e81 or 8.3999999999999996e175 < z Initial program 81.3%
Taylor expanded in z around inf 67.4%
mul-1-neg67.4%
distribute-neg-frac267.4%
sub-neg67.4%
distribute-neg-in67.4%
remove-double-neg67.4%
+-commutative67.4%
sub-neg67.4%
associate-/l*65.4%
Simplified65.4%
if -7.6000000000000005e54 < z < 3.79999999999999995e61 or 1.19999999999999995e81 < z < 8.3999999999999996e175Initial program 77.4%
Taylor expanded in a around inf 69.0%
+-commutative69.0%
Simplified69.0%
Final simplification67.7%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -7.2e+55)
(not
(or (<= z 1.25e+67) (and (not (<= z 6.5e+80)) (<= z 2.65e+175)))))
(* y (/ z t))
(+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.2e+55) || !((z <= 1.25e+67) || (!(z <= 6.5e+80) && (z <= 2.65e+175)))) {
tmp = y * (z / t);
} 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 ((z <= (-7.2d+55)) .or. (.not. (z <= 1.25d+67) .or. (.not. (z <= 6.5d+80)) .and. (z <= 2.65d+175))) then
tmp = y * (z / t)
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 ((z <= -7.2e+55) || !((z <= 1.25e+67) || (!(z <= 6.5e+80) && (z <= 2.65e+175)))) {
tmp = y * (z / t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.2e+55) or not ((z <= 1.25e+67) or (not (z <= 6.5e+80) and (z <= 2.65e+175))): tmp = y * (z / t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.2e+55) || !((z <= 1.25e+67) || (!(z <= 6.5e+80) && (z <= 2.65e+175)))) tmp = Float64(y * Float64(z / t)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.2e+55) || ~(((z <= 1.25e+67) || (~((z <= 6.5e+80)) && (z <= 2.65e+175))))) tmp = y * (z / t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.2e+55], N[Not[Or[LessEqual[z, 1.25e+67], And[N[Not[LessEqual[z, 6.5e+80]], $MachinePrecision], LessEqual[z, 2.65e+175]]]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+55} \lor \neg \left(z \leq 1.25 \cdot 10^{+67} \lor \neg \left(z \leq 6.5 \cdot 10^{+80}\right) \land z \leq 2.65 \cdot 10^{+175}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -7.19999999999999975e55 or 1.24999999999999994e67 < z < 6.4999999999999998e80 or 2.65000000000000006e175 < z Initial program 80.9%
Taylor expanded in z around inf 66.7%
mul-1-neg66.7%
distribute-neg-frac266.7%
sub-neg66.7%
distribute-neg-in66.7%
remove-double-neg66.7%
+-commutative66.7%
sub-neg66.7%
associate-/l*64.7%
Simplified64.7%
Taylor expanded in t around inf 50.4%
associate-*r/51.4%
Simplified51.4%
if -7.19999999999999975e55 < z < 1.24999999999999994e67 or 6.4999999999999998e80 < z < 2.65000000000000006e175Initial program 77.6%
Taylor expanded in a around inf 68.3%
+-commutative68.3%
Simplified68.3%
Final simplification62.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z t))))
(if (<= z -1.8e+57)
t_1
(if (<= z 1.25e+67)
(+ x y)
(if (<= z 2.1e+81) t_1 (if (<= z 1.45e+162) (+ x y) (/ (* y z) t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / t);
double tmp;
if (z <= -1.8e+57) {
tmp = t_1;
} else if (z <= 1.25e+67) {
tmp = x + y;
} else if (z <= 2.1e+81) {
tmp = t_1;
} else if (z <= 1.45e+162) {
tmp = x + y;
} else {
tmp = (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) :: t_1
real(8) :: tmp
t_1 = y * (z / t)
if (z <= (-1.8d+57)) then
tmp = t_1
else if (z <= 1.25d+67) then
tmp = x + y
else if (z <= 2.1d+81) then
tmp = t_1
else if (z <= 1.45d+162) then
tmp = x + y
else
tmp = (y * z) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / t);
double tmp;
if (z <= -1.8e+57) {
tmp = t_1;
} else if (z <= 1.25e+67) {
tmp = x + y;
} else if (z <= 2.1e+81) {
tmp = t_1;
} else if (z <= 1.45e+162) {
tmp = x + y;
} else {
tmp = (y * z) / t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / t) tmp = 0 if z <= -1.8e+57: tmp = t_1 elif z <= 1.25e+67: tmp = x + y elif z <= 2.1e+81: tmp = t_1 elif z <= 1.45e+162: tmp = x + y else: tmp = (y * z) / t return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / t)) tmp = 0.0 if (z <= -1.8e+57) tmp = t_1; elseif (z <= 1.25e+67) tmp = Float64(x + y); elseif (z <= 2.1e+81) tmp = t_1; elseif (z <= 1.45e+162) tmp = Float64(x + y); else tmp = Float64(Float64(y * z) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / t); tmp = 0.0; if (z <= -1.8e+57) tmp = t_1; elseif (z <= 1.25e+67) tmp = x + y; elseif (z <= 2.1e+81) tmp = t_1; elseif (z <= 1.45e+162) tmp = x + y; else tmp = (y * z) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+57], t$95$1, If[LessEqual[z, 1.25e+67], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.1e+81], t$95$1, If[LessEqual[z, 1.45e+162], N[(x + y), $MachinePrecision], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t}\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+67}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+162}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.8000000000000001e57 or 1.24999999999999994e67 < z < 2.0999999999999999e81Initial program 74.4%
Taylor expanded in z around inf 58.7%
mul-1-neg58.7%
distribute-neg-frac258.7%
sub-neg58.7%
distribute-neg-in58.7%
remove-double-neg58.7%
+-commutative58.7%
sub-neg58.7%
associate-/l*58.9%
Simplified58.9%
Taylor expanded in t around inf 44.6%
associate-*r/50.5%
Simplified50.5%
if -1.8000000000000001e57 < z < 1.24999999999999994e67 or 2.0999999999999999e81 < z < 1.45000000000000003e162Initial program 77.9%
Taylor expanded in a around inf 68.5%
+-commutative68.5%
Simplified68.5%
if 1.45000000000000003e162 < z Initial program 93.5%
Taylor expanded in z around inf 83.5%
mul-1-neg83.5%
distribute-neg-frac283.5%
sub-neg83.5%
distribute-neg-in83.5%
remove-double-neg83.5%
+-commutative83.5%
sub-neg83.5%
associate-/l*73.4%
Simplified73.4%
Taylor expanded in t around inf 63.6%
Final simplification63.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z t))))
(if (<= z -1.7e+57)
t_1
(if (<= z 1.12e+67)
(+ x y)
(if (<= z 8.5e+80) t_1 (if (<= z 8.5e+152) (+ x y) (* (/ y t) z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / t);
double tmp;
if (z <= -1.7e+57) {
tmp = t_1;
} else if (z <= 1.12e+67) {
tmp = x + y;
} else if (z <= 8.5e+80) {
tmp = t_1;
} else if (z <= 8.5e+152) {
tmp = x + y;
} else {
tmp = (y / 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) :: t_1
real(8) :: tmp
t_1 = y * (z / t)
if (z <= (-1.7d+57)) then
tmp = t_1
else if (z <= 1.12d+67) then
tmp = x + y
else if (z <= 8.5d+80) then
tmp = t_1
else if (z <= 8.5d+152) then
tmp = x + y
else
tmp = (y / t) * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / t);
double tmp;
if (z <= -1.7e+57) {
tmp = t_1;
} else if (z <= 1.12e+67) {
tmp = x + y;
} else if (z <= 8.5e+80) {
tmp = t_1;
} else if (z <= 8.5e+152) {
tmp = x + y;
} else {
tmp = (y / t) * z;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / t) tmp = 0 if z <= -1.7e+57: tmp = t_1 elif z <= 1.12e+67: tmp = x + y elif z <= 8.5e+80: tmp = t_1 elif z <= 8.5e+152: tmp = x + y else: tmp = (y / t) * z return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / t)) tmp = 0.0 if (z <= -1.7e+57) tmp = t_1; elseif (z <= 1.12e+67) tmp = Float64(x + y); elseif (z <= 8.5e+80) tmp = t_1; elseif (z <= 8.5e+152) tmp = Float64(x + y); else tmp = Float64(Float64(y / t) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / t); tmp = 0.0; if (z <= -1.7e+57) tmp = t_1; elseif (z <= 1.12e+67) tmp = x + y; elseif (z <= 8.5e+80) tmp = t_1; elseif (z <= 8.5e+152) tmp = x + y; else tmp = (y / t) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+57], t$95$1, If[LessEqual[z, 1.12e+67], N[(x + y), $MachinePrecision], If[LessEqual[z, 8.5e+80], t$95$1, If[LessEqual[z, 8.5e+152], N[(x + y), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{+67}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+152}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t} \cdot z\\
\end{array}
\end{array}
if z < -1.69999999999999996e57 or 1.12e67 < z < 8.50000000000000007e80Initial program 74.4%
Taylor expanded in z around inf 58.7%
mul-1-neg58.7%
distribute-neg-frac258.7%
sub-neg58.7%
distribute-neg-in58.7%
remove-double-neg58.7%
+-commutative58.7%
sub-neg58.7%
associate-/l*58.9%
Simplified58.9%
Taylor expanded in t around inf 44.6%
associate-*r/50.5%
Simplified50.5%
if -1.69999999999999996e57 < z < 1.12e67 or 8.50000000000000007e80 < z < 8.4999999999999993e152Initial program 77.9%
Taylor expanded in a around inf 68.5%
+-commutative68.5%
Simplified68.5%
if 8.4999999999999993e152 < z Initial program 93.5%
sub-neg93.5%
+-commutative93.5%
distribute-frac-neg93.5%
distribute-rgt-neg-out93.5%
associate-/l*90.1%
fma-define90.1%
distribute-frac-neg90.1%
distribute-neg-frac290.1%
sub-neg90.1%
distribute-neg-in90.1%
remove-double-neg90.1%
+-commutative90.1%
sub-neg90.1%
Simplified90.1%
Taylor expanded in a around 0 70.1%
Taylor expanded in y around 0 70.1%
Taylor expanded in x around 0 63.6%
*-commutative63.6%
associate-*r/57.0%
Simplified57.0%
Final simplification62.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.1e+96) (not (<= t 9.2e+54))) (+ (- x (* a (/ y t))) (* y (/ z t))) (+ (+ x y) (* (- z t) (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.1e+96) || !(t <= 9.2e+54)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) + ((z - t) * (y / (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 <= (-2.1d+96)) .or. (.not. (t <= 9.2d+54))) then
tmp = (x - (a * (y / t))) + (y * (z / t))
else
tmp = (x + y) + ((z - t) * (y / (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 <= -2.1e+96) || !(t <= 9.2e+54)) {
tmp = (x - (a * (y / t))) + (y * (z / t));
} else {
tmp = (x + y) + ((z - t) * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.1e+96) or not (t <= 9.2e+54): tmp = (x - (a * (y / t))) + (y * (z / t)) else: tmp = (x + y) + ((z - t) * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.1e+96) || !(t <= 9.2e+54)) tmp = Float64(Float64(x - Float64(a * Float64(y / t))) + Float64(y * Float64(z / t))); else tmp = Float64(Float64(x + y) + Float64(Float64(z - t) * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.1e+96) || ~((t <= 9.2e+54))) tmp = (x - (a * (y / t))) + (y * (z / t)); else tmp = (x + y) + ((z - t) * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.1e+96], N[Not[LessEqual[t, 9.2e+54]], $MachinePrecision]], N[(N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(z - t), $MachinePrecision] * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+96} \lor \neg \left(t \leq 9.2 \cdot 10^{+54}\right):\\
\;\;\;\;\left(x - a \cdot \frac{y}{t}\right) + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(z - t\right) \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if t < -2.1000000000000001e96 or 9.19999999999999977e54 < t Initial program 54.5%
Taylor expanded in t around inf 79.2%
sub-neg79.2%
mul-1-neg79.2%
unsub-neg79.2%
associate-/l*88.1%
mul-1-neg88.1%
remove-double-neg88.1%
associate-/l*94.0%
Simplified94.0%
if -2.1000000000000001e96 < t < 9.19999999999999977e54Initial program 93.7%
associate-/l*92.8%
*-commutative92.8%
Applied egg-rr92.8%
Final simplification93.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.3e-5) (not (<= a 1.8e-86))) (- (+ x y) (* y (/ z a))) (+ x (/ (- (* y z) (* a y)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.3e-5) || !(a <= 1.8e-86)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + (((y * z) - (a * y)) / 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 <= (-5.3d-5)) .or. (.not. (a <= 1.8d-86))) then
tmp = (x + y) - (y * (z / a))
else
tmp = x + (((y * z) - (a * y)) / 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 <= -5.3e-5) || !(a <= 1.8e-86)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + (((y * z) - (a * y)) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.3e-5) or not (a <= 1.8e-86): tmp = (x + y) - (y * (z / a)) else: tmp = x + (((y * z) - (a * y)) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.3e-5) || !(a <= 1.8e-86)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(Float64(y * z) - Float64(a * y)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5.3e-5) || ~((a <= 1.8e-86))) tmp = (x + y) - (y * (z / a)); else tmp = x + (((y * z) - (a * y)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.3e-5], N[Not[LessEqual[a, 1.8e-86]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y * z), $MachinePrecision] - N[(a * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.3 \cdot 10^{-5} \lor \neg \left(a \leq 1.8 \cdot 10^{-86}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z - a \cdot y}{t}\\
\end{array}
\end{array}
if a < -5.3000000000000001e-5 or 1.79999999999999983e-86 < a Initial program 80.4%
Taylor expanded in t around 0 80.0%
+-commutative80.0%
associate-/l*82.7%
Simplified82.7%
if -5.3000000000000001e-5 < a < 1.79999999999999983e-86Initial program 76.9%
Taylor expanded in t around -inf 85.9%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.15e-24) (not (<= a 1.5e-87))) (- (+ x y) (* y (/ z a))) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.15e-24) || !(a <= 1.5e-87)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((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 ((a <= (-3.15d-24)) .or. (.not. (a <= 1.5d-87))) then
tmp = (x + y) - (y * (z / a))
else
tmp = x + ((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 ((a <= -3.15e-24) || !(a <= 1.5e-87)) {
tmp = (x + y) - (y * (z / a));
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.15e-24) or not (a <= 1.5e-87): tmp = (x + y) - (y * (z / a)) else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.15e-24) || !(a <= 1.5e-87)) tmp = Float64(Float64(x + y) - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.15e-24) || ~((a <= 1.5e-87))) tmp = (x + y) - (y * (z / a)); else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.15e-24], N[Not[LessEqual[a, 1.5e-87]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.15 \cdot 10^{-24} \lor \neg \left(a \leq 1.5 \cdot 10^{-87}\right):\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -3.1499999999999999e-24 or 1.50000000000000008e-87 < a Initial program 80.1%
Taylor expanded in t around 0 79.8%
+-commutative79.8%
associate-/l*82.4%
Simplified82.4%
if -3.1499999999999999e-24 < a < 1.50000000000000008e-87Initial program 77.2%
sub-neg77.2%
+-commutative77.2%
distribute-frac-neg77.2%
distribute-rgt-neg-out77.2%
associate-/l*72.6%
fma-define72.8%
distribute-frac-neg72.8%
distribute-neg-frac272.8%
sub-neg72.8%
distribute-neg-in72.8%
remove-double-neg72.8%
+-commutative72.8%
sub-neg72.8%
Simplified72.8%
Taylor expanded in a around 0 71.8%
Taylor expanded in y around 0 85.5%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9.6e+129) (not (<= a 1.4e+49))) (+ x y) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.6e+129) || !(a <= 1.4e+49)) {
tmp = x + y;
} else {
tmp = x + ((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 ((a <= (-9.6d+129)) .or. (.not. (a <= 1.4d+49))) then
tmp = x + y
else
tmp = x + ((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 ((a <= -9.6e+129) || !(a <= 1.4e+49)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9.6e+129) or not (a <= 1.4e+49): tmp = x + y else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -9.6e+129) || !(a <= 1.4e+49)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -9.6e+129) || ~((a <= 1.4e+49))) tmp = x + y; else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -9.6e+129], N[Not[LessEqual[a, 1.4e+49]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.6 \cdot 10^{+129} \lor \neg \left(a \leq 1.4 \cdot 10^{+49}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if a < -9.5999999999999995e129 or 1.3999999999999999e49 < a Initial program 84.1%
Taylor expanded in a around inf 87.9%
+-commutative87.9%
Simplified87.9%
if -9.5999999999999995e129 < a < 1.3999999999999999e49Initial program 76.2%
sub-neg76.2%
+-commutative76.2%
distribute-frac-neg76.2%
distribute-rgt-neg-out76.2%
associate-/l*73.6%
fma-define73.7%
distribute-frac-neg73.7%
distribute-neg-frac273.7%
sub-neg73.7%
distribute-neg-in73.7%
remove-double-neg73.7%
+-commutative73.7%
sub-neg73.7%
Simplified73.7%
Taylor expanded in a around 0 61.6%
Taylor expanded in y around 0 74.3%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.15e-223) (not (<= a 2.7e-23))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.15e-223) || !(a <= 2.7e-23)) {
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 <= (-2.15d-223)) .or. (.not. (a <= 2.7d-23))) 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 <= -2.15e-223) || !(a <= 2.7e-23)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.15e-223) or not (a <= 2.7e-23): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.15e-223) || !(a <= 2.7e-23)) 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 <= -2.15e-223) || ~((a <= 2.7e-23))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.15e-223], N[Not[LessEqual[a, 2.7e-23]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.15 \cdot 10^{-223} \lor \neg \left(a \leq 2.7 \cdot 10^{-23}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.15e-223 or 2.69999999999999985e-23 < a Initial program 82.6%
Taylor expanded in a around inf 64.3%
+-commutative64.3%
Simplified64.3%
if -2.15e-223 < a < 2.69999999999999985e-23Initial program 71.3%
Taylor expanded in x around inf 41.4%
Final simplification56.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 78.8%
Taylor expanded in x around inf 43.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)))
(t_2 (- (+ x y) (/ (* (- z t) y) (- a t)))))
(if (< t_2 -1.3664970889390727e-7)
t_1
(if (< t_2 1.4754293444577233e-239)
(/ (- (* y (- a z)) (* x t)) (- a t))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + x) - (((z - t) * (1.0d0 / (a - t))) * y)
t_2 = (x + y) - (((z - t) * y) / (a - t))
if (t_2 < (-1.3664970889390727d-7)) then
tmp = t_1
else if (t_2 < 1.4754293444577233d-239) then
tmp = ((y * (a - z)) - (x * t)) / (a - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y);
double t_2 = (x + y) - (((z - t) * y) / (a - t));
double tmp;
if (t_2 < -1.3664970889390727e-7) {
tmp = t_1;
} else if (t_2 < 1.4754293444577233e-239) {
tmp = ((y * (a - z)) - (x * t)) / (a - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y) t_2 = (x + y) - (((z - t) * y) / (a - t)) tmp = 0 if t_2 < -1.3664970889390727e-7: tmp = t_1 elif t_2 < 1.4754293444577233e-239: tmp = ((y * (a - z)) - (x * t)) / (a - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y + x) - Float64(Float64(Float64(z - t) * Float64(1.0 / Float64(a - t))) * y)) t_2 = Float64(Float64(x + y) - Float64(Float64(Float64(z - t) * y) / Float64(a - t))) tmp = 0.0 if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = Float64(Float64(Float64(y * Float64(a - z)) - Float64(x * t)) / Float64(a - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y + x) - (((z - t) * (1.0 / (a - t))) * y); t_2 = (x + y) - (((z - t) * y) / (a - t)); tmp = 0.0; if (t_2 < -1.3664970889390727e-7) tmp = t_1; elseif (t_2 < 1.4754293444577233e-239) tmp = ((y * (a - z)) - (x * t)) / (a - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] - N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -1.3664970889390727e-7], t$95$1, If[Less[t$95$2, 1.4754293444577233e-239], N[(N[(N[(y * N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\
t_2 := \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t\_2 < -1.3664970889390727 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024110
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))