
(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 12 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) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (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 * ((t - z) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (a - t)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (a - t)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{a - t}
\end{array}
Initial program 85.5%
associate-/l*99.1%
Simplified99.1%
Final simplification99.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (- 1.0 (/ z t)))))
(if (<= y -3.3e+87)
t_1
(if (<= y 9.2e-96) x (if (<= y 4.6e+160) (+ x y) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (1.0 - (z / t));
double tmp;
if (y <= -3.3e+87) {
tmp = t_1;
} else if (y <= 9.2e-96) {
tmp = x;
} else if (y <= 4.6e+160) {
tmp = x + y;
} 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 = y * (1.0d0 - (z / t))
if (y <= (-3.3d+87)) then
tmp = t_1
else if (y <= 9.2d-96) then
tmp = x
else if (y <= 4.6d+160) then
tmp = x + y
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 * (1.0 - (z / t));
double tmp;
if (y <= -3.3e+87) {
tmp = t_1;
} else if (y <= 9.2e-96) {
tmp = x;
} else if (y <= 4.6e+160) {
tmp = x + y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (1.0 - (z / t)) tmp = 0 if y <= -3.3e+87: tmp = t_1 elif y <= 9.2e-96: tmp = x elif y <= 4.6e+160: tmp = x + y else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(1.0 - Float64(z / t))) tmp = 0.0 if (y <= -3.3e+87) tmp = t_1; elseif (y <= 9.2e-96) tmp = x; elseif (y <= 4.6e+160) tmp = Float64(x + y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (1.0 - (z / t)); tmp = 0.0; if (y <= -3.3e+87) tmp = t_1; elseif (y <= 9.2e-96) tmp = x; elseif (y <= 4.6e+160) tmp = x + y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.3e+87], t$95$1, If[LessEqual[y, 9.2e-96], x, If[LessEqual[y, 4.6e+160], N[(x + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-96}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+160}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.3000000000000001e87 or 4.59999999999999975e160 < y Initial program 63.9%
+-commutative63.9%
*-commutative63.9%
associate-/l*96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in a around 0 42.0%
mul-1-neg42.0%
unsub-neg42.0%
associate-/l*71.0%
div-sub71.0%
sub-neg71.0%
*-inverses71.0%
metadata-eval71.0%
Simplified71.0%
Taylor expanded in x around 0 65.7%
sub-neg65.7%
metadata-eval65.7%
neg-mul-165.7%
distribute-rgt-neg-out65.7%
+-commutative65.7%
distribute-neg-in65.7%
metadata-eval65.7%
sub-neg65.7%
Simplified65.7%
if -3.3000000000000001e87 < y < 9.2e-96Initial program 99.9%
+-commutative99.9%
*-commutative99.9%
associate-/l*98.0%
fma-define97.9%
Simplified97.9%
Taylor expanded in y around 0 73.8%
if 9.2e-96 < y < 4.59999999999999975e160Initial program 83.6%
+-commutative83.6%
*-commutative83.6%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in t around inf 55.0%
+-commutative55.0%
Simplified55.0%
Final simplification67.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a t))))
(if (or (<= t -6e+63) (not (<= t 490000000.0)))
(- x (* t t_1))
(+ x (* z t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - t);
double tmp;
if ((t <= -6e+63) || !(t <= 490000000.0)) {
tmp = x - (t * t_1);
} else {
tmp = x + (z * 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 = y / (a - t)
if ((t <= (-6d+63)) .or. (.not. (t <= 490000000.0d0))) then
tmp = x - (t * t_1)
else
tmp = x + (z * 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 / (a - t);
double tmp;
if ((t <= -6e+63) || !(t <= 490000000.0)) {
tmp = x - (t * t_1);
} else {
tmp = x + (z * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - t) tmp = 0 if (t <= -6e+63) or not (t <= 490000000.0): tmp = x - (t * t_1) else: tmp = x + (z * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - t)) tmp = 0.0 if ((t <= -6e+63) || !(t <= 490000000.0)) tmp = Float64(x - Float64(t * t_1)); else tmp = Float64(x + Float64(z * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - t); tmp = 0.0; if ((t <= -6e+63) || ~((t <= 490000000.0))) tmp = x - (t * t_1); else tmp = x + (z * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -6e+63], N[Not[LessEqual[t, 490000000.0]], $MachinePrecision]], N[(x - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - t}\\
\mathbf{if}\;t \leq -6 \cdot 10^{+63} \lor \neg \left(t \leq 490000000\right):\\
\;\;\;\;x - t \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot t\_1\\
\end{array}
\end{array}
if t < -5.99999999999999998e63 or 4.9e8 < t Initial program 70.8%
*-commutative70.8%
associate-*r/97.8%
*-commutative97.8%
Applied egg-rr97.8%
Taylor expanded in z around 0 66.2%
mul-1-neg66.2%
unsub-neg66.2%
associate-/l*88.3%
Simplified88.3%
if -5.99999999999999998e63 < t < 4.9e8Initial program 96.7%
*-commutative96.7%
associate-*r/97.9%
*-commutative97.9%
Applied egg-rr97.9%
Taylor expanded in z around inf 92.0%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.25e+138) (not (<= t 7.4e+18))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.25e+138) || !(t <= 7.4e+18)) {
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 <= (-2.25d+138)) .or. (.not. (t <= 7.4d+18))) 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 <= -2.25e+138) || !(t <= 7.4e+18)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.25e+138) or not (t <= 7.4e+18): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.25e+138) || !(t <= 7.4e+18)) 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 <= -2.25e+138) || ~((t <= 7.4e+18))) 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, -2.25e+138], N[Not[LessEqual[t, 7.4e+18]], $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 -2.25 \cdot 10^{+138} \lor \neg \left(t \leq 7.4 \cdot 10^{+18}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -2.24999999999999991e138 or 7.4e18 < t Initial program 68.6%
+-commutative68.6%
*-commutative68.6%
associate-/l*97.3%
fma-define97.2%
Simplified97.2%
Taylor expanded in t around inf 83.0%
+-commutative83.0%
Simplified83.0%
if -2.24999999999999991e138 < t < 7.4e18Initial program 94.5%
*-commutative94.5%
associate-*r/98.2%
*-commutative98.2%
Applied egg-rr98.2%
Taylor expanded in z around inf 89.0%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.7e+20) (+ x (* y (- 1.0 (/ z t)))) (if (<= t 2400000.0) (+ x (* z (/ y (- a t)))) (- x (* y (/ t (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.7e+20) {
tmp = x + (y * (1.0 - (z / t)));
} else if (t <= 2400000.0) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y * (t / (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 <= (-4.7d+20)) then
tmp = x + (y * (1.0d0 - (z / t)))
else if (t <= 2400000.0d0) then
tmp = x + (z * (y / (a - t)))
else
tmp = x - (y * (t / (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 <= -4.7e+20) {
tmp = x + (y * (1.0 - (z / t)));
} else if (t <= 2400000.0) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x - (y * (t / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.7e+20: tmp = x + (y * (1.0 - (z / t))) elif t <= 2400000.0: tmp = x + (z * (y / (a - t))) else: tmp = x - (y * (t / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.7e+20) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); elseif (t <= 2400000.0) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.7e+20) tmp = x + (y * (1.0 - (z / t))); elseif (t <= 2400000.0) tmp = x + (z * (y / (a - t))); else tmp = x - (y * (t / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.7e+20], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2400000.0], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{+20}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{elif}\;t \leq 2400000:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\end{array}
\end{array}
if t < -4.7e20Initial program 71.8%
+-commutative71.8%
*-commutative71.8%
associate-/l*98.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in a around 0 61.1%
mul-1-neg61.1%
unsub-neg61.1%
associate-/l*88.3%
div-sub88.3%
sub-neg88.3%
*-inverses88.3%
metadata-eval88.3%
Simplified88.3%
if -4.7e20 < t < 2.4e6Initial program 97.2%
*-commutative97.2%
associate-*r/97.8%
*-commutative97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 93.0%
if 2.4e6 < t Initial program 72.6%
+-commutative72.6%
*-commutative72.6%
associate-/l*97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in z around 0 66.2%
mul-1-neg66.2%
unsub-neg66.2%
*-commutative66.2%
*-lft-identity66.2%
times-frac90.5%
/-rgt-identity90.5%
Simplified90.5%
Final simplification91.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a t))))
(if (<= t -2.35e+23)
(+ x (* y (- 1.0 (/ z t))))
(if (<= t 820000000.0) (+ x (* z t_1)) (- x (* t t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - t);
double tmp;
if (t <= -2.35e+23) {
tmp = x + (y * (1.0 - (z / t)));
} else if (t <= 820000000.0) {
tmp = x + (z * t_1);
} else {
tmp = x - (t * 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 = y / (a - t)
if (t <= (-2.35d+23)) then
tmp = x + (y * (1.0d0 - (z / t)))
else if (t <= 820000000.0d0) then
tmp = x + (z * t_1)
else
tmp = x - (t * 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 / (a - t);
double tmp;
if (t <= -2.35e+23) {
tmp = x + (y * (1.0 - (z / t)));
} else if (t <= 820000000.0) {
tmp = x + (z * t_1);
} else {
tmp = x - (t * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - t) tmp = 0 if t <= -2.35e+23: tmp = x + (y * (1.0 - (z / t))) elif t <= 820000000.0: tmp = x + (z * t_1) else: tmp = x - (t * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - t)) tmp = 0.0 if (t <= -2.35e+23) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); elseif (t <= 820000000.0) tmp = Float64(x + Float64(z * t_1)); else tmp = Float64(x - Float64(t * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - t); tmp = 0.0; if (t <= -2.35e+23) tmp = x + (y * (1.0 - (z / t))); elseif (t <= 820000000.0) tmp = x + (z * t_1); else tmp = x - (t * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.35e+23], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 820000000.0], N[(x + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - t}\\
\mathbf{if}\;t \leq -2.35 \cdot 10^{+23}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{elif}\;t \leq 820000000:\\
\;\;\;\;x + z \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot t\_1\\
\end{array}
\end{array}
if t < -2.3499999999999999e23Initial program 71.8%
+-commutative71.8%
*-commutative71.8%
associate-/l*98.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in a around 0 61.1%
mul-1-neg61.1%
unsub-neg61.1%
associate-/l*88.3%
div-sub88.3%
sub-neg88.3%
*-inverses88.3%
metadata-eval88.3%
Simplified88.3%
if -2.3499999999999999e23 < t < 8.2e8Initial program 97.2%
*-commutative97.2%
associate-*r/97.8%
*-commutative97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 93.0%
if 8.2e8 < t Initial program 72.6%
*-commutative72.6%
associate-*r/97.6%
*-commutative97.6%
Applied egg-rr97.6%
Taylor expanded in z around 0 66.2%
mul-1-neg66.2%
unsub-neg66.2%
associate-/l*89.7%
Simplified89.7%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.56e-9) (not (<= t 7.2e+15))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.56e-9) || !(t <= 7.2e+15)) {
tmp = x + y;
} else {
tmp = x + (z * (y / 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.56d-9)) .or. (.not. (t <= 7.2d+15))) then
tmp = x + y
else
tmp = x + (z * (y / 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.56e-9) || !(t <= 7.2e+15)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.56e-9) or not (t <= 7.2e+15): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.56e-9) || !(t <= 7.2e+15)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.56e-9) || ~((t <= 7.2e+15))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.56e-9], N[Not[LessEqual[t, 7.2e+15]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.56 \cdot 10^{-9} \lor \neg \left(t \leq 7.2 \cdot 10^{+15}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.56e-9 or 7.2e15 < t Initial program 72.6%
+-commutative72.6%
*-commutative72.6%
associate-/l*98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in t around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -1.56e-9 < t < 7.2e15Initial program 97.8%
+-commutative97.8%
*-commutative97.8%
associate-/l*97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in t around 0 79.4%
+-commutative79.4%
associate-/l*80.0%
Simplified80.0%
clear-num80.0%
un-div-inv80.7%
Applied egg-rr80.7%
associate-/r/81.5%
Simplified81.5%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e-68) (not (<= t 4.1e+15))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e-68) || !(t <= 4.1e+15)) {
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 <= (-2.2d-68)) .or. (.not. (t <= 4.1d+15))) 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 <= -2.2e-68) || !(t <= 4.1e+15)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e-68) or not (t <= 4.1e+15): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e-68) || !(t <= 4.1e+15)) 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 <= -2.2e-68) || ~((t <= 4.1e+15))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e-68], N[Not[LessEqual[t, 4.1e+15]], $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 -2.2 \cdot 10^{-68} \lor \neg \left(t \leq 4.1 \cdot 10^{+15}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -2.20000000000000002e-68 or 4.1e15 < t Initial program 74.6%
+-commutative74.6%
*-commutative74.6%
associate-/l*98.2%
fma-define98.1%
Simplified98.1%
Taylor expanded in t around inf 78.4%
+-commutative78.4%
Simplified78.4%
if -2.20000000000000002e-68 < t < 4.1e15Initial program 97.6%
+-commutative97.6%
*-commutative97.6%
associate-/l*97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in t around 0 78.4%
+-commutative78.4%
associate-/l*79.9%
Simplified79.9%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e-10) (not (<= t 4.7e-54))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e-10) || !(t <= 4.7e-54)) {
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 <= (-9d-10)) .or. (.not. (t <= 4.7d-54))) 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 <= -9e-10) || !(t <= 4.7e-54)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e-10) or not (t <= 4.7e-54): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e-10) || !(t <= 4.7e-54)) 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 <= -9e-10) || ~((t <= 4.7e-54))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e-10], N[Not[LessEqual[t, 4.7e-54]], $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 -9 \cdot 10^{-10} \lor \neg \left(t \leq 4.7 \cdot 10^{-54}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -8.9999999999999999e-10 or 4.7e-54 < t Initial program 74.3%
+-commutative74.3%
*-commutative74.3%
associate-/l*98.2%
fma-define98.1%
Simplified98.1%
Taylor expanded in t around inf 73.8%
+-commutative73.8%
Simplified73.8%
if -8.9999999999999999e-10 < t < 4.7e-54Initial program 98.3%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in t around 0 83.8%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.7e+180) y (if (<= y 1.65e+157) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.7e+180) {
tmp = y;
} else if (y <= 1.65e+157) {
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 <= (-5.7d+180)) then
tmp = y
else if (y <= 1.65d+157) 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 <= -5.7e+180) {
tmp = y;
} else if (y <= 1.65e+157) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.7e+180: tmp = y elif y <= 1.65e+157: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.7e+180) tmp = y; elseif (y <= 1.65e+157) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.7e+180) tmp = y; elseif (y <= 1.65e+157) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.7e+180], y, If[LessEqual[y, 1.65e+157], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.7 \cdot 10^{+180}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+157}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -5.7000000000000002e180 or 1.6500000000000001e157 < y Initial program 58.4%
+-commutative58.4%
*-commutative58.4%
associate-/l*95.2%
fma-define95.2%
Simplified95.2%
Taylor expanded in t around inf 51.1%
+-commutative51.1%
Simplified51.1%
Taylor expanded in y around inf 43.4%
if -5.7000000000000002e180 < y < 1.6500000000000001e157Initial program 93.8%
+-commutative93.8%
*-commutative93.8%
associate-/l*98.7%
fma-define98.6%
Simplified98.6%
Taylor expanded in y around 0 59.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.65e+200) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.65e+200) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.65d+200)) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.65e+200) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.65e+200: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.65e+200) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.65e+200) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.65e+200], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.65 \cdot 10^{+200}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -2.64999999999999997e200Initial program 100.0%
+-commutative100.0%
*-commutative100.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around 0 91.3%
if -2.64999999999999997e200 < a Initial program 84.1%
+-commutative84.1%
*-commutative84.1%
associate-/l*97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in t around inf 60.4%
+-commutative60.4%
Simplified60.4%
Final simplification63.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.5%
+-commutative85.5%
*-commutative85.5%
associate-/l*97.9%
fma-define97.8%
Simplified97.8%
Taylor expanded in y around 0 49.4%
(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 2024181
(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))))