
(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 84.4%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- z t) (/ y a))) (t_2 (* t (/ y (- t a)))))
(if (<= y -3.6e+261)
t_2
(if (<= y -7.8e+75)
t_1
(if (<= y 4.5e+128)
(+ x y)
(if (<= y 4.2e+198) x (if (<= y 1.07e+226) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * (y / a);
double t_2 = t * (y / (t - a));
double tmp;
if (y <= -3.6e+261) {
tmp = t_2;
} else if (y <= -7.8e+75) {
tmp = t_1;
} else if (y <= 4.5e+128) {
tmp = x + y;
} else if (y <= 4.2e+198) {
tmp = x;
} else if (y <= 1.07e+226) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = (z - t) * (y / a)
t_2 = t * (y / (t - a))
if (y <= (-3.6d+261)) then
tmp = t_2
else if (y <= (-7.8d+75)) then
tmp = t_1
else if (y <= 4.5d+128) then
tmp = x + y
else if (y <= 4.2d+198) then
tmp = x
else if (y <= 1.07d+226) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * (y / a);
double t_2 = t * (y / (t - a));
double tmp;
if (y <= -3.6e+261) {
tmp = t_2;
} else if (y <= -7.8e+75) {
tmp = t_1;
} else if (y <= 4.5e+128) {
tmp = x + y;
} else if (y <= 4.2e+198) {
tmp = x;
} else if (y <= 1.07e+226) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) * (y / a) t_2 = t * (y / (t - a)) tmp = 0 if y <= -3.6e+261: tmp = t_2 elif y <= -7.8e+75: tmp = t_1 elif y <= 4.5e+128: tmp = x + y elif y <= 4.2e+198: tmp = x elif y <= 1.07e+226: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) * Float64(y / a)) t_2 = Float64(t * Float64(y / Float64(t - a))) tmp = 0.0 if (y <= -3.6e+261) tmp = t_2; elseif (y <= -7.8e+75) tmp = t_1; elseif (y <= 4.5e+128) tmp = Float64(x + y); elseif (y <= 4.2e+198) tmp = x; elseif (y <= 1.07e+226) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) * (y / a); t_2 = t * (y / (t - a)); tmp = 0.0; if (y <= -3.6e+261) tmp = t_2; elseif (y <= -7.8e+75) tmp = t_1; elseif (y <= 4.5e+128) tmp = x + y; elseif (y <= 4.2e+198) tmp = x; elseif (y <= 1.07e+226) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e+261], t$95$2, If[LessEqual[y, -7.8e+75], t$95$1, If[LessEqual[y, 4.5e+128], N[(x + y), $MachinePrecision], If[LessEqual[y, 4.2e+198], x, If[LessEqual[y, 1.07e+226], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot \frac{y}{a}\\
t_2 := t \cdot \frac{y}{t - a}\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+261}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -7.8 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+128}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+198}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.07 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -3.60000000000000018e261 or 1.07e226 < y Initial program 40.0%
+-commutative40.0%
*-commutative40.0%
associate-/l*94.1%
fma-define94.1%
Simplified94.1%
Taylor expanded in z around 0 22.4%
mul-1-neg22.4%
unsub-neg22.4%
*-commutative22.4%
*-lft-identity22.4%
times-frac74.1%
/-rgt-identity74.1%
Simplified74.1%
clear-num74.1%
un-div-inv74.2%
Applied egg-rr74.2%
Taylor expanded in x around 0 22.2%
mul-1-neg22.2%
associate-*r/79.7%
distribute-rgt-neg-in79.7%
distribute-frac-neg279.7%
neg-sub079.7%
sub-neg79.7%
+-commutative79.7%
associate--r+79.7%
neg-sub079.7%
remove-double-neg79.7%
Simplified79.7%
if -3.60000000000000018e261 < y < -7.80000000000000075e75 or 4.20000000000000026e198 < y < 1.07e226Initial program 73.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 53.3%
Taylor expanded in x around 0 44.1%
*-commutative44.1%
associate-*r/53.9%
*-commutative53.9%
Simplified53.9%
if -7.80000000000000075e75 < y < 4.5000000000000001e128Initial program 96.9%
+-commutative96.9%
*-commutative96.9%
associate-/l*95.8%
fma-define95.8%
Simplified95.8%
Taylor expanded in t around inf 75.0%
+-commutative75.0%
Simplified75.0%
if 4.5000000000000001e128 < y < 4.20000000000000026e198Initial program 78.9%
+-commutative78.9%
*-commutative78.9%
associate-/l*93.2%
fma-define93.2%
Simplified93.2%
Taylor expanded in y around 0 61.5%
Final simplification71.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y (- t a)))))
(if (<= y -4e+229)
t_1
(if (<= y -2e+173)
(* y (/ z a))
(if (<= y 4.8e+128) (+ x y) (if (<= y 4.8e+197) x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / (t - a));
double tmp;
if (y <= -4e+229) {
tmp = t_1;
} else if (y <= -2e+173) {
tmp = y * (z / a);
} else if (y <= 4.8e+128) {
tmp = x + y;
} else if (y <= 4.8e+197) {
tmp = x;
} 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) :: tmp
t_1 = t * (y / (t - a))
if (y <= (-4d+229)) then
tmp = t_1
else if (y <= (-2d+173)) then
tmp = y * (z / a)
else if (y <= 4.8d+128) then
tmp = x + y
else if (y <= 4.8d+197) then
tmp = x
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 = t * (y / (t - a));
double tmp;
if (y <= -4e+229) {
tmp = t_1;
} else if (y <= -2e+173) {
tmp = y * (z / a);
} else if (y <= 4.8e+128) {
tmp = x + y;
} else if (y <= 4.8e+197) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / (t - a)) tmp = 0 if y <= -4e+229: tmp = t_1 elif y <= -2e+173: tmp = y * (z / a) elif y <= 4.8e+128: tmp = x + y elif y <= 4.8e+197: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / Float64(t - a))) tmp = 0.0 if (y <= -4e+229) tmp = t_1; elseif (y <= -2e+173) tmp = Float64(y * Float64(z / a)); elseif (y <= 4.8e+128) tmp = Float64(x + y); elseif (y <= 4.8e+197) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / (t - a)); tmp = 0.0; if (y <= -4e+229) tmp = t_1; elseif (y <= -2e+173) tmp = y * (z / a); elseif (y <= 4.8e+128) tmp = x + y; elseif (y <= 4.8e+197) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e+229], t$95$1, If[LessEqual[y, -2e+173], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+128], N[(x + y), $MachinePrecision], If[LessEqual[y, 4.8e+197], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{t - a}\\
\mathbf{if}\;y \leq -4 \cdot 10^{+229}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2 \cdot 10^{+173}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+128}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+197}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4e229 or 4.7999999999999998e197 < y Initial program 46.1%
+-commutative46.1%
*-commutative46.1%
associate-/l*96.0%
fma-define96.0%
Simplified96.0%
Taylor expanded in z around 0 23.6%
mul-1-neg23.6%
unsub-neg23.6%
*-commutative23.6%
*-lft-identity23.6%
times-frac65.1%
/-rgt-identity65.1%
Simplified65.1%
clear-num65.1%
un-div-inv65.2%
Applied egg-rr65.2%
Taylor expanded in x around 0 19.5%
mul-1-neg19.5%
associate-*r/64.0%
distribute-rgt-neg-in64.0%
distribute-frac-neg264.0%
neg-sub064.0%
sub-neg64.0%
+-commutative64.0%
associate--r+64.0%
neg-sub064.0%
remove-double-neg64.0%
Simplified64.0%
if -4e229 < y < -2e173Initial program 83.2%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around inf 65.9%
Taylor expanded in x around 0 65.9%
*-commutative65.9%
associate-*r/74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in z around inf 65.4%
associate-/l*74.1%
Simplified74.1%
if -2e173 < y < 4.8000000000000004e128Initial program 95.1%
+-commutative95.1%
*-commutative95.1%
associate-/l*96.2%
fma-define96.3%
Simplified96.3%
Taylor expanded in t around inf 70.8%
+-commutative70.8%
Simplified70.8%
if 4.8000000000000004e128 < y < 4.7999999999999998e197Initial program 78.9%
+-commutative78.9%
*-commutative78.9%
associate-/l*93.2%
fma-define93.2%
Simplified93.2%
Taylor expanded in y around 0 61.5%
Final simplification69.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7e+124) (not (<= z 230000000000.0))) (+ x (* z (/ y (- a t)))) (+ x (* y (/ t (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7e+124) || !(z <= 230000000000.0)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y * (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 ((z <= (-7d+124)) .or. (.not. (z <= 230000000000.0d0))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (y * (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 ((z <= -7e+124) || !(z <= 230000000000.0)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7e+124) or not (z <= 230000000000.0): tmp = x + (z * (y / (a - t))) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7e+124) || !(z <= 230000000000.0)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7e+124) || ~((z <= 230000000000.0))) tmp = x + (z * (y / (a - t))); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e+124], N[Not[LessEqual[z, 230000000000.0]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+124} \lor \neg \left(z \leq 230000000000\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if z < -7.0000000000000002e124 or 2.3e11 < z Initial program 78.5%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around inf 78.8%
div-inv78.8%
*-commutative78.8%
associate-*l*91.9%
div-inv92.0%
Applied egg-rr92.0%
if -7.0000000000000002e124 < z < 2.3e11Initial program 87.6%
+-commutative87.6%
*-commutative87.6%
associate-/l*95.3%
fma-define95.3%
Simplified95.3%
Taylor expanded in z around 0 77.7%
mul-1-neg77.7%
unsub-neg77.7%
*-commutative77.7%
*-lft-identity77.7%
times-frac89.4%
/-rgt-identity89.4%
Simplified89.4%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+125) (not (<= z 2.4e-47))) (+ x (* z (/ y (- a t)))) (+ x (* t (/ y (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+125) || !(z <= 2.4e-47)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (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 ((z <= (-1.1d+125)) .or. (.not. (z <= 2.4d-47))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (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 ((z <= -1.1e+125) || !(z <= 2.4e-47)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (t * (y / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+125) or not (z <= 2.4e-47): tmp = x + (z * (y / (a - t))) else: tmp = x + (t * (y / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+125) || !(z <= 2.4e-47)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e+125) || ~((z <= 2.4e-47))) tmp = x + (z * (y / (a - t))); else tmp = x + (t * (y / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e+125], N[Not[LessEqual[z, 2.4e-47]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+125} \lor \neg \left(z \leq 2.4 \cdot 10^{-47}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{t - a}\\
\end{array}
\end{array}
if z < -1.09999999999999995e125 or 2.3999999999999999e-47 < z Initial program 79.5%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 77.8%
div-inv77.7%
*-commutative77.7%
associate-*l*89.7%
div-inv89.8%
Applied egg-rr89.8%
if -1.09999999999999995e125 < z < 2.3999999999999999e-47Initial program 87.5%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 78.8%
mul-1-neg78.8%
unsub-neg78.8%
associate-/l*88.2%
Simplified88.2%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7e+129) (not (<= t 8.4e-75))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7e+129) || !(t <= 8.4e-75)) {
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 <= (-7d+129)) .or. (.not. (t <= 8.4d-75))) 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 <= -7e+129) || !(t <= 8.4e-75)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7e+129) or not (t <= 8.4e-75): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7e+129) || !(t <= 8.4e-75)) 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 <= -7e+129) || ~((t <= 8.4e-75))) 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, -7e+129], N[Not[LessEqual[t, 8.4e-75]], $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 -7 \cdot 10^{+129} \lor \neg \left(t \leq 8.4 \cdot 10^{-75}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -6.9999999999999997e129 or 8.4000000000000004e-75 < t Initial program 73.1%
+-commutative73.1%
*-commutative73.1%
associate-/l*95.7%
fma-define95.7%
Simplified95.7%
Taylor expanded in t around inf 78.7%
+-commutative78.7%
Simplified78.7%
if -6.9999999999999997e129 < t < 8.4000000000000004e-75Initial program 93.3%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 83.8%
div-inv83.8%
*-commutative83.8%
associate-*l*87.7%
div-inv87.8%
Applied egg-rr87.8%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -65000000.0) (not (<= t 7.7e-88))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -65000000.0) || !(t <= 7.7e-88)) {
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 <= (-65000000.0d0)) .or. (.not. (t <= 7.7d-88))) 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 <= -65000000.0) || !(t <= 7.7e-88)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -65000000.0) or not (t <= 7.7e-88): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -65000000.0) || !(t <= 7.7e-88)) 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 <= -65000000.0) || ~((t <= 7.7e-88))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -65000000.0], N[Not[LessEqual[t, 7.7e-88]], $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 -65000000 \lor \neg \left(t \leq 7.7 \cdot 10^{-88}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -6.5e7 or 7.70000000000000004e-88 < t Initial program 75.1%
+-commutative75.1%
*-commutative75.1%
associate-/l*96.0%
fma-define96.0%
Simplified96.0%
Taylor expanded in t around inf 73.2%
+-commutative73.2%
Simplified73.2%
if -6.5e7 < t < 7.70000000000000004e-88Initial program 96.5%
associate-/l*97.3%
Simplified97.3%
clear-num97.2%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in t around 0 84.7%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.45e+14) (not (<= t 2.25e-89))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.45e+14) || !(t <= 2.25e-89)) {
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 <= (-1.45d+14)) .or. (.not. (t <= 2.25d-89))) 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 <= -1.45e+14) || !(t <= 2.25e-89)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.45e+14) or not (t <= 2.25e-89): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.45e+14) || !(t <= 2.25e-89)) 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 <= -1.45e+14) || ~((t <= 2.25e-89))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.45e+14], N[Not[LessEqual[t, 2.25e-89]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{+14} \lor \neg \left(t \leq 2.25 \cdot 10^{-89}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.45e14 or 2.25e-89 < t Initial program 74.7%
+-commutative74.7%
*-commutative74.7%
associate-/l*95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in t around inf 73.5%
+-commutative73.5%
Simplified73.5%
if -1.45e14 < t < 2.25e-89Initial program 96.5%
+-commutative96.5%
*-commutative96.5%
associate-/l*96.5%
fma-define96.5%
Simplified96.5%
Taylor expanded in y around 0 55.2%
Final simplification65.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.42e+147) y (if (<= y 3e+227) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.42e+147) {
tmp = y;
} else if (y <= 3e+227) {
tmp = x;
} else {
tmp = 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 (y <= (-1.42d+147)) then
tmp = y
else if (y <= 3d+227) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.42e+147) {
tmp = y;
} else if (y <= 3e+227) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.42e+147: tmp = y elif y <= 3e+227: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.42e+147) tmp = y; elseif (y <= 3e+227) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.42e+147) tmp = y; elseif (y <= 3e+227) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.42e+147], y, If[LessEqual[y, 3e+227], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.42 \cdot 10^{+147}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+227}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -1.42e147 or 2.99999999999999986e227 < y Initial program 55.4%
+-commutative55.4%
*-commutative55.4%
associate-/l*96.6%
fma-define96.6%
Simplified96.6%
Taylor expanded in t around inf 46.1%
+-commutative46.1%
Simplified46.1%
Taylor expanded in y around inf 44.5%
if -1.42e147 < y < 2.99999999999999986e227Initial program 92.7%
+-commutative92.7%
*-commutative92.7%
associate-/l*96.1%
fma-define96.1%
Simplified96.1%
Taylor expanded in y around 0 61.8%
(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 84.4%
+-commutative84.4%
*-commutative84.4%
associate-/l*96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in y around 0 50.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 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))))