
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
Initial program 80.1%
associate-/l*98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.4e+75)
(+ x y)
(if (<= t -16.0)
(- x (/ y (/ t z)))
(if (<= t 6e+58) (+ x (* z (/ y a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.4e+75) {
tmp = x + y;
} else if (t <= -16.0) {
tmp = x - (y / (t / z));
} else if (t <= 6e+58) {
tmp = x + (z * (y / 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 (t <= (-1.4d+75)) then
tmp = x + y
else if (t <= (-16.0d0)) then
tmp = x - (y / (t / z))
else if (t <= 6d+58) then
tmp = x + (z * (y / 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 (t <= -1.4e+75) {
tmp = x + y;
} else if (t <= -16.0) {
tmp = x - (y / (t / z));
} else if (t <= 6e+58) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.4e+75: tmp = x + y elif t <= -16.0: tmp = x - (y / (t / z)) elif t <= 6e+58: tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.4e+75) tmp = Float64(x + y); elseif (t <= -16.0) tmp = Float64(x - Float64(y / Float64(t / z))); elseif (t <= 6e+58) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.4e+75) tmp = x + y; elseif (t <= -16.0) tmp = x - (y / (t / z)); elseif (t <= 6e+58) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.4e+75], N[(x + y), $MachinePrecision], If[LessEqual[t, -16.0], N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+58], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+75}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -16:\\
\;\;\;\;x - \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+58}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.40000000000000006e75 or 6.0000000000000005e58 < t Initial program 61.3%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in t around inf 86.8%
if -1.40000000000000006e75 < t < -16Initial program 93.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 85.0%
Taylor expanded in a around 0 78.0%
+-commutative78.0%
mul-1-neg78.0%
unsub-neg78.0%
associate-/l*85.0%
Simplified85.0%
if -16 < t < 6.0000000000000005e58Initial program 93.6%
+-commutative93.6%
associate-*r/96.4%
fma-def96.4%
Simplified96.4%
fma-udef96.4%
Applied egg-rr96.4%
Taylor expanded in t around 0 78.4%
associate-*l/81.7%
*-commutative81.7%
Simplified81.7%
Final simplification84.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4e+82) (not (<= t 1.1e+71))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4e+82) || !(t <= 1.1e+71)) {
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 <= (-4d+82)) .or. (.not. (t <= 1.1d+71))) 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 <= -4e+82) || !(t <= 1.1e+71)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4e+82) or not (t <= 1.1e+71): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4e+82) || !(t <= 1.1e+71)) 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 <= -4e+82) || ~((t <= 1.1e+71))) 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, -4e+82], N[Not[LessEqual[t, 1.1e+71]], $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 -4 \cdot 10^{+82} \lor \neg \left(t \leq 1.1 \cdot 10^{+71}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -3.9999999999999999e82 or 1.09999999999999997e71 < t Initial program 59.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in t around inf 87.9%
if -3.9999999999999999e82 < t < 1.09999999999999997e71Initial program 93.7%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in z around inf 88.8%
associate-*l/91.3%
*-commutative91.3%
Simplified91.3%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.8e+83) (not (<= t 6.5e+96))) (+ x y) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.8e+83) || !(t <= 6.5e+96)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - 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) :: tmp
if ((t <= (-5.8d+83)) .or. (.not. (t <= 6.5d+96))) then
tmp = x + y
else
tmp = x + (y / ((a - t) / 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 <= -5.8e+83) || !(t <= 6.5e+96)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.8e+83) or not (t <= 6.5e+96): tmp = x + y else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.8e+83) || !(t <= 6.5e+96)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.8e+83) || ~((t <= 6.5e+96))) tmp = x + y; else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.8e+83], N[Not[LessEqual[t, 6.5e+96]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+83} \lor \neg \left(t \leq 6.5 \cdot 10^{+96}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -5.79999999999999999e83 or 6.5e96 < t Initial program 57.9%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in t around inf 89.1%
if -5.79999999999999999e83 < t < 6.5e96Initial program 93.3%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in z around inf 91.6%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.4e+49) (not (<= t 1.35e+95))) (- x (/ y (+ (/ a t) -1.0))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.4e+49) || !(t <= 1.35e+95)) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = x + (y / ((a - 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) :: tmp
if ((t <= (-5.4d+49)) .or. (.not. (t <= 1.35d+95))) then
tmp = x - (y / ((a / t) + (-1.0d0)))
else
tmp = x + (y / ((a - t) / 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 <= -5.4e+49) || !(t <= 1.35e+95)) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.4e+49) or not (t <= 1.35e+95): tmp = x - (y / ((a / t) + -1.0)) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.4e+49) || !(t <= 1.35e+95)) tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.4e+49) || ~((t <= 1.35e+95))) tmp = x - (y / ((a / t) + -1.0)); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.4e+49], N[Not[LessEqual[t, 1.35e+95]], $MachinePrecision]], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+49} \lor \neg \left(t \leq 1.35 \cdot 10^{+95}\right):\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -5.4000000000000002e49 or 1.35e95 < t Initial program 60.0%
associate-*l/99.0%
Simplified99.0%
Taylor expanded in z around 0 56.1%
+-commutative56.1%
mul-1-neg56.1%
unsub-neg56.1%
associate-/l*91.5%
div-sub91.5%
sub-neg91.5%
*-inverses91.5%
metadata-eval91.5%
Simplified91.5%
if -5.4000000000000002e49 < t < 1.35e95Initial program 93.1%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in z around inf 91.9%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -7.8e+28) (+ x y) (if (<= t 2.3e+58) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.8e+28) {
tmp = x + y;
} else if (t <= 2.3e+58) {
tmp = x + (y * (z / 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 (t <= (-7.8d+28)) then
tmp = x + y
else if (t <= 2.3d+58) then
tmp = x + (y * (z / 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 (t <= -7.8e+28) {
tmp = x + y;
} else if (t <= 2.3e+58) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.8e+28: tmp = x + y elif t <= 2.3e+58: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.8e+28) tmp = Float64(x + y); elseif (t <= 2.3e+58) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.8e+28) tmp = x + y; elseif (t <= 2.3e+58) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.8e+28], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.3e+58], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{+28}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+58}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.7999999999999997e28 or 2.30000000000000002e58 < t Initial program 62.9%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in t around inf 84.3%
if -7.7999999999999997e28 < t < 2.30000000000000002e58Initial program 93.8%
+-commutative93.8%
associate-*r/96.6%
fma-def96.5%
Simplified96.5%
fma-udef96.6%
Applied egg-rr96.6%
Taylor expanded in t around 0 80.3%
Final simplification82.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -8.2e+28) (+ x y) (if (<= t 3.8e+58) (+ x (* z (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.2e+28) {
tmp = x + y;
} else if (t <= 3.8e+58) {
tmp = x + (z * (y / 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 (t <= (-8.2d+28)) then
tmp = x + y
else if (t <= 3.8d+58) then
tmp = x + (z * (y / 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 (t <= -8.2e+28) {
tmp = x + y;
} else if (t <= 3.8e+58) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -8.2e+28: tmp = x + y elif t <= 3.8e+58: tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.2e+28) tmp = Float64(x + y); elseif (t <= 3.8e+58) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -8.2e+28) tmp = x + y; elseif (t <= 3.8e+58) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.2e+28], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.8e+58], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+28}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+58}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -8.19999999999999961e28 or 3.7999999999999999e58 < t Initial program 62.9%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in t around inf 84.3%
if -8.19999999999999961e28 < t < 3.7999999999999999e58Initial program 93.8%
+-commutative93.8%
associate-*r/96.6%
fma-def96.5%
Simplified96.5%
fma-udef96.6%
Applied egg-rr96.6%
Taylor expanded in t around 0 77.2%
associate-*l/80.4%
*-commutative80.4%
Simplified80.4%
Final simplification82.2%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 80.1%
associate-*l/96.9%
Simplified96.9%
Final simplification96.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -4e+46) (+ x y) (if (<= t 2.4e-46) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e+46) {
tmp = x + y;
} else if (t <= 2.4e-46) {
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 (t <= (-4d+46)) then
tmp = x + y
else if (t <= 2.4d-46) 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 (t <= -4e+46) {
tmp = x + y;
} else if (t <= 2.4e-46) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4e+46: tmp = x + y elif t <= 2.4e-46: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4e+46) tmp = Float64(x + y); elseif (t <= 2.4e-46) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4e+46) tmp = x + y; elseif (t <= 2.4e-46) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4e+46], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.4e-46], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+46}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-46}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4e46 or 2.40000000000000013e-46 < t Initial program 67.4%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in t around inf 80.4%
if -4e46 < t < 2.40000000000000013e-46Initial program 93.1%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in x around inf 49.3%
Final simplification65.1%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.2e+83) y (if (<= y 2.8e+219) x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.2e+83) {
tmp = y;
} else if (y <= 2.8e+219) {
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 <= (-4.2d+83)) then
tmp = y
else if (y <= 2.8d+219) 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 <= -4.2e+83) {
tmp = y;
} else if (y <= 2.8e+219) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.2e+83: tmp = y elif y <= 2.8e+219: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.2e+83) tmp = y; elseif (y <= 2.8e+219) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.2e+83) tmp = y; elseif (y <= 2.8e+219) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.2e+83], y, If[LessEqual[y, 2.8e+219], x, y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+83}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+219}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -4.20000000000000005e83 or 2.80000000000000015e219 < y Initial program 47.7%
+-commutative47.7%
associate-*r/98.4%
fma-def98.4%
Simplified98.4%
fma-udef98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 41.8%
Taylor expanded in t around inf 36.4%
if -4.20000000000000005e83 < y < 2.80000000000000015e219Initial program 91.8%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in x around inf 61.6%
Final simplification54.9%
(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 80.1%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in x around inf 50.8%
Final simplification50.8%
(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 2023229
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))