
(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 (/ (- 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 86.4%
associate-/l*98.2%
Simplified98.2%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3e-37)
(+ x y)
(if (<= t 7.2e-93)
(+ x (/ (* y z) a))
(if (<= t 1.52e+124) (- x (/ y (/ t z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3e-37) {
tmp = x + y;
} else if (t <= 7.2e-93) {
tmp = x + ((y * z) / a);
} else if (t <= 1.52e+124) {
tmp = x - (y / (t / z));
} 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 (t <= (-3d-37)) then
tmp = x + y
else if (t <= 7.2d-93) then
tmp = x + ((y * z) / a)
else if (t <= 1.52d+124) then
tmp = x - (y / (t / z))
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 (t <= -3e-37) {
tmp = x + y;
} else if (t <= 7.2e-93) {
tmp = x + ((y * z) / a);
} else if (t <= 1.52e+124) {
tmp = x - (y / (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3e-37: tmp = x + y elif t <= 7.2e-93: tmp = x + ((y * z) / a) elif t <= 1.52e+124: tmp = x - (y / (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3e-37) tmp = Float64(x + y); elseif (t <= 7.2e-93) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (t <= 1.52e+124) tmp = Float64(x - Float64(y / Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3e-37) tmp = x + y; elseif (t <= 7.2e-93) tmp = x + ((y * z) / a); elseif (t <= 1.52e+124) tmp = x - (y / (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3e-37], N[(x + y), $MachinePrecision], If[LessEqual[t, 7.2e-93], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.52e+124], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-37}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-93}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq 1.52 \cdot 10^{+124}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3e-37 or 1.51999999999999998e124 < t Initial program 73.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -3e-37 < t < 7.2000000000000003e-93Initial program 98.9%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in t around 0 86.9%
if 7.2000000000000003e-93 < t < 1.51999999999999998e124Initial program 90.0%
associate-/l*99.9%
Simplified99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 82.5%
Taylor expanded in a around 0 76.3%
neg-mul-176.3%
distribute-neg-frac276.3%
Simplified76.3%
Final simplification81.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.2e-39)
(+ x y)
(if (<= t 2.4e-92)
(+ x (/ (* y z) a))
(if (<= t 2.9e+121) (- x (* y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.2e-39) {
tmp = x + y;
} else if (t <= 2.4e-92) {
tmp = x + ((y * z) / a);
} else if (t <= 2.9e+121) {
tmp = x - (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 (t <= (-1.2d-39)) then
tmp = x + y
else if (t <= 2.4d-92) then
tmp = x + ((y * z) / a)
else if (t <= 2.9d+121) then
tmp = x - (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 (t <= -1.2e-39) {
tmp = x + y;
} else if (t <= 2.4e-92) {
tmp = x + ((y * z) / a);
} else if (t <= 2.9e+121) {
tmp = x - (y * (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.2e-39: tmp = x + y elif t <= 2.4e-92: tmp = x + ((y * z) / a) elif t <= 2.9e+121: tmp = x - (y * (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.2e-39) tmp = Float64(x + y); elseif (t <= 2.4e-92) tmp = Float64(x + Float64(Float64(y * z) / a)); elseif (t <= 2.9e+121) tmp = Float64(x - 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 (t <= -1.2e-39) tmp = x + y; elseif (t <= 2.4e-92) tmp = x + ((y * z) / a); elseif (t <= 2.9e+121) tmp = x - (y * (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.2e-39], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.4e-92], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+121], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-39}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-92}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+121}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.20000000000000008e-39 or 2.8999999999999999e121 < t Initial program 73.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -1.20000000000000008e-39 < t < 2.4000000000000001e-92Initial program 98.9%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in t around 0 86.9%
if 2.4000000000000001e-92 < t < 2.8999999999999999e121Initial program 90.0%
associate-/l*99.9%
Simplified99.9%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 82.5%
Taylor expanded in a around 0 74.4%
mul-1-neg74.4%
unsub-neg74.4%
associate-/l*76.2%
Simplified76.2%
Final simplification81.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.7e-37) (not (<= t 1e-111))) (+ x (/ y (/ t (- t z)))) (+ x (/ (* y z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e-37) || !(t <= 1e-111)) {
tmp = x + (y / (t / (t - z)));
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.7d-37)) .or. (.not. (t <= 1d-111))) then
tmp = x + (y / (t / (t - z)))
else
tmp = x + ((y * z) / (a - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e-37) || !(t <= 1e-111)) {
tmp = x + (y / (t / (t - z)));
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.7e-37) or not (t <= 1e-111): tmp = x + (y / (t / (t - z))) else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.7e-37) || !(t <= 1e-111)) tmp = Float64(x + Float64(y / Float64(t / Float64(t - z)))); else tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.7e-37) || ~((t <= 1e-111))) tmp = x + (y / (t / (t - z))); else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.7e-37], N[Not[LessEqual[t, 1e-111]], $MachinePrecision]], N[(x + N[(y / N[(t / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-37} \lor \neg \left(t \leq 10^{-111}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -2.70000000000000016e-37 or 1.00000000000000009e-111 < t Initial program 79.6%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in a around 0 90.6%
neg-mul-190.6%
distribute-neg-frac290.6%
Simplified90.6%
if -2.70000000000000016e-37 < t < 1.00000000000000009e-111Initial program 98.9%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in z around inf 93.4%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.7e-37) (not (<= t 1e-111))) (+ x (* y (/ (- t z) t))) (+ x (/ (* y z) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e-37) || !(t <= 1e-111)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.7d-37)) .or. (.not. (t <= 1d-111))) then
tmp = x + (y * ((t - z) / t))
else
tmp = x + ((y * z) / (a - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e-37) || !(t <= 1e-111)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + ((y * z) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.7e-37) or not (t <= 1e-111): tmp = x + (y * ((t - z) / t)) else: tmp = x + ((y * z) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.7e-37) || !(t <= 1e-111)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); else tmp = Float64(x + Float64(Float64(y * z) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.7e-37) || ~((t <= 1e-111))) tmp = x + (y * ((t - z) / t)); else tmp = x + ((y * z) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.7e-37], N[Not[LessEqual[t, 1e-111]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-37} \lor \neg \left(t \leq 10^{-111}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a - t}\\
\end{array}
\end{array}
if t < -2.70000000000000016e-37 or 1.00000000000000009e-111 < t Initial program 79.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 73.1%
mul-1-neg73.1%
associate-/l*90.6%
distribute-rgt-neg-in90.6%
distribute-frac-neg90.6%
neg-sub090.6%
sub-neg90.6%
+-commutative90.6%
associate--r+90.6%
neg-sub090.6%
remove-double-neg90.6%
Simplified90.6%
if -2.70000000000000016e-37 < t < 1.00000000000000009e-111Initial program 98.9%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in z around inf 93.4%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.1e-37) (not (<= t 1e-111))) (+ x (* y (/ (- t z) t))) (- x (/ y (/ (- t a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.1e-37) || !(t <= 1e-111)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x - (y / ((t - 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 <= (-3.1d-37)) .or. (.not. (t <= 1d-111))) then
tmp = x + (y * ((t - z) / t))
else
tmp = x - (y / ((t - 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 <= -3.1e-37) || !(t <= 1e-111)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x - (y / ((t - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.1e-37) or not (t <= 1e-111): tmp = x + (y * ((t - z) / t)) else: tmp = x - (y / ((t - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.1e-37) || !(t <= 1e-111)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); else tmp = Float64(x - Float64(y / Float64(Float64(t - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.1e-37) || ~((t <= 1e-111))) tmp = x + (y * ((t - z) / t)); else tmp = x - (y / ((t - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.1e-37], N[Not[LessEqual[t, 1e-111]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{-37} \lor \neg \left(t \leq 10^{-111}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t - a}{z}}\\
\end{array}
\end{array}
if t < -3.09999999999999993e-37 or 1.00000000000000009e-111 < t Initial program 79.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 73.1%
mul-1-neg73.1%
associate-/l*90.6%
distribute-rgt-neg-in90.6%
distribute-frac-neg90.6%
neg-sub090.6%
sub-neg90.6%
+-commutative90.6%
associate--r+90.6%
neg-sub090.6%
remove-double-neg90.6%
Simplified90.6%
if -3.09999999999999993e-37 < t < 1.00000000000000009e-111Initial program 98.9%
associate-/l*95.0%
Simplified95.0%
clear-num95.0%
un-div-inv94.9%
Applied egg-rr94.9%
Taylor expanded in z around inf 89.4%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.4e-40) (not (<= t 3.4e-131))) (+ x (* y (/ (- t z) t))) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.4e-40) || !(t <= 3.4e-131)) {
tmp = x + (y * ((t - z) / t));
} 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.4d-40)) .or. (.not. (t <= 3.4d-131))) then
tmp = x + (y * ((t - z) / t))
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.4e-40) || !(t <= 3.4e-131)) {
tmp = x + (y * ((t - z) / t));
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.4e-40) or not (t <= 3.4e-131): tmp = x + (y * ((t - z) / t)) else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.4e-40) || !(t <= 3.4e-131)) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / t))); 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 <= -2.4e-40) || ~((t <= 3.4e-131))) tmp = x + (y * ((t - z) / t)); else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.4e-40], N[Not[LessEqual[t, 3.4e-131]], $MachinePrecision]], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-40} \lor \neg \left(t \leq 3.4 \cdot 10^{-131}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -2.39999999999999991e-40 or 3.39999999999999995e-131 < t Initial program 80.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around 0 73.2%
mul-1-neg73.2%
associate-/l*90.3%
distribute-rgt-neg-in90.3%
distribute-frac-neg90.3%
neg-sub090.3%
sub-neg90.3%
+-commutative90.3%
associate--r+90.3%
neg-sub090.3%
remove-double-neg90.3%
Simplified90.3%
if -2.39999999999999991e-40 < t < 3.39999999999999995e-131Initial program 98.8%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in t around 0 89.0%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.9e-40) (not (<= t 5.2e-96))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.9e-40) || !(t <= 5.2e-96)) {
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.9d-40)) .or. (.not. (t <= 5.2d-96))) 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.9e-40) || !(t <= 5.2e-96)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.9e-40) or not (t <= 5.2e-96): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.9e-40) || !(t <= 5.2e-96)) 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 <= -2.9e-40) || ~((t <= 5.2e-96))) 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.9e-40], N[Not[LessEqual[t, 5.2e-96]], $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 -2.9 \cdot 10^{-40} \lor \neg \left(t \leq 5.2 \cdot 10^{-96}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -2.8999999999999999e-40 or 5.2000000000000003e-96 < t Initial program 79.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 74.5%
+-commutative74.5%
Simplified74.5%
if -2.8999999999999999e-40 < t < 5.2000000000000003e-96Initial program 98.9%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in t around 0 87.5%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e-39) (not (<= t 2.7e+53))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e-39) || !(t <= 2.7e+53)) {
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 <= (-3.4d-39)) .or. (.not. (t <= 2.7d+53))) 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 <= -3.4e-39) || !(t <= 2.7e+53)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.4e-39) or not (t <= 2.7e+53): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e-39) || !(t <= 2.7e+53)) 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 <= -3.4e-39) || ~((t <= 2.7e+53))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e-39], N[Not[LessEqual[t, 2.7e+53]], $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 -3.4 \cdot 10^{-39} \lor \neg \left(t \leq 2.7 \cdot 10^{+53}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -3.3999999999999999e-39 or 2.70000000000000019e53 < t Initial program 74.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -3.3999999999999999e-39 < t < 2.70000000000000019e53Initial program 97.8%
add-cube-cbrt97.1%
pow397.2%
Applied egg-rr97.2%
Taylor expanded in t around 0 81.0%
associate-/l*79.8%
Simplified79.8%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.15e-38) (not (<= t 1.18e-147))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.15e-38) || !(t <= 1.18e-147)) {
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.15d-38)) .or. (.not. (t <= 1.18d-147))) 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.15e-38) || !(t <= 1.18e-147)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.15e-38) or not (t <= 1.18e-147): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.15e-38) || !(t <= 1.18e-147)) 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.15e-38) || ~((t <= 1.18e-147))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.15e-38], N[Not[LessEqual[t, 1.18e-147]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{-38} \lor \neg \left(t \leq 1.18 \cdot 10^{-147}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.15000000000000001e-38 or 1.18000000000000003e-147 < t Initial program 80.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 73.6%
+-commutative73.6%
Simplified73.6%
if -1.15000000000000001e-38 < t < 1.18000000000000003e-147Initial program 98.8%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in x around inf 58.8%
Final simplification68.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.2e-83) x (if (<= x 5.3e-191) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.2e-83) {
tmp = x;
} else if (x <= 5.3e-191) {
tmp = 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 (x <= (-1.2d-83)) then
tmp = x
else if (x <= 5.3d-191) then
tmp = 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 (x <= -1.2e-83) {
tmp = x;
} else if (x <= 5.3e-191) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.2e-83: tmp = x elif x <= 5.3e-191: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.2e-83) tmp = x; elseif (x <= 5.3e-191) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.2e-83) tmp = x; elseif (x <= 5.3e-191) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.2e-83], x, If[LessEqual[x, 5.3e-191], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-83}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{-191}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.2e-83 or 5.29999999999999985e-191 < x Initial program 88.7%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in x around inf 65.0%
if -1.2e-83 < x < 5.29999999999999985e-191Initial program 80.6%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in t around inf 48.5%
+-commutative48.5%
Simplified48.5%
Taylor expanded in y around inf 48.5%
Taylor expanded in y around inf 41.2%
(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 86.4%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in x around inf 50.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 2024137
(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))))