
(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 13 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 (* (/ (- z t) (- a t)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (a - t)) * y);
}
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) / (a - t)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (a - t)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (a - t)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(a - t)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (a - t)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{a - t} \cdot y
\end{array}
Initial program 84.6%
associate-/l*99.9%
Simplified99.9%
clear-num99.8%
associate-/r/99.8%
clear-num99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.7e+108)
x
(if (<= a -2.75e-220)
(+ x y)
(if (<= a -4.2e-299)
(* y (- 1.0 (/ z t)))
(if (<= a 6.2e+98) (+ x y) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e+108) {
tmp = x;
} else if (a <= -2.75e-220) {
tmp = x + y;
} else if (a <= -4.2e-299) {
tmp = y * (1.0 - (z / t));
} else if (a <= 6.2e+98) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.7d+108)) then
tmp = x
else if (a <= (-2.75d-220)) then
tmp = x + y
else if (a <= (-4.2d-299)) then
tmp = y * (1.0d0 - (z / t))
else if (a <= 6.2d+98) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e+108) {
tmp = x;
} else if (a <= -2.75e-220) {
tmp = x + y;
} else if (a <= -4.2e-299) {
tmp = y * (1.0 - (z / t));
} else if (a <= 6.2e+98) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.7e+108: tmp = x elif a <= -2.75e-220: tmp = x + y elif a <= -4.2e-299: tmp = y * (1.0 - (z / t)) elif a <= 6.2e+98: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.7e+108) tmp = x; elseif (a <= -2.75e-220) tmp = Float64(x + y); elseif (a <= -4.2e-299) tmp = Float64(y * Float64(1.0 - Float64(z / t))); elseif (a <= 6.2e+98) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.7e+108) tmp = x; elseif (a <= -2.75e-220) tmp = x + y; elseif (a <= -4.2e-299) tmp = y * (1.0 - (z / t)); elseif (a <= 6.2e+98) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.7e+108], x, If[LessEqual[a, -2.75e-220], N[(x + y), $MachinePrecision], If[LessEqual[a, -4.2e-299], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.2e+98], N[(x + y), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+108}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -2.75 \cdot 10^{-220}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-299}:\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{+98}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.7e108 or 6.20000000000000038e98 < a Initial program 83.8%
+-commutative83.8%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in y around 0 71.4%
if -2.7e108 < a < -2.7499999999999999e-220 or -4.2000000000000002e-299 < a < 6.20000000000000038e98Initial program 84.5%
+-commutative84.5%
associate-*l/94.9%
fma-def94.9%
Simplified94.9%
Taylor expanded in t around inf 68.7%
+-commutative68.7%
Simplified68.7%
if -2.7499999999999999e-220 < a < -4.2000000000000002e-299Initial program 88.9%
+-commutative88.9%
associate-*l/77.4%
fma-def77.4%
Simplified77.4%
Taylor expanded in a around 0 88.9%
mul-1-neg88.9%
unsub-neg88.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around inf 88.2%
Final simplification70.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.05e+136)
(+ x y)
(if (<= t -6.5e+73)
(- x (* y (/ z t)))
(if (<= t 7.2e+42) (+ x (/ y (/ a z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.05e+136) {
tmp = x + y;
} else if (t <= -6.5e+73) {
tmp = x - (y * (z / t));
} else if (t <= 7.2e+42) {
tmp = x + (y / (a / 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 <= (-1.05d+136)) then
tmp = x + y
else if (t <= (-6.5d+73)) then
tmp = x - (y * (z / t))
else if (t <= 7.2d+42) then
tmp = x + (y / (a / 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 <= -1.05e+136) {
tmp = x + y;
} else if (t <= -6.5e+73) {
tmp = x - (y * (z / t));
} else if (t <= 7.2e+42) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.05e+136: tmp = x + y elif t <= -6.5e+73: tmp = x - (y * (z / t)) elif t <= 7.2e+42: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.05e+136) tmp = Float64(x + y); elseif (t <= -6.5e+73) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 7.2e+42) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.05e+136) tmp = x + y; elseif (t <= -6.5e+73) tmp = x - (y * (z / t)); elseif (t <= 7.2e+42) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.05e+136], N[(x + y), $MachinePrecision], If[LessEqual[t, -6.5e+73], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+42], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+136}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{+73}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.05e136 or 7.2000000000000002e42 < t Initial program 71.3%
+-commutative71.3%
associate-*l/94.7%
fma-def94.7%
Simplified94.7%
Taylor expanded in t around inf 82.1%
+-commutative82.1%
Simplified82.1%
if -1.05e136 < t < -6.5000000000000001e73Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 93.5%
Taylor expanded in a around 0 87.0%
mul-1-neg87.0%
unsub-neg87.0%
associate-/l*87.1%
associate-/r/86.9%
Simplified86.9%
Taylor expanded in y around 0 87.0%
associate-*r/86.8%
Simplified86.8%
if -6.5000000000000001e73 < t < 7.2000000000000002e42Initial program 91.6%
+-commutative91.6%
associate-*l/93.4%
fma-def93.4%
Simplified93.4%
Taylor expanded in t around 0 71.4%
+-commutative71.4%
associate-/l*77.7%
Simplified77.7%
Final simplification79.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7e+135)
(+ x y)
(if (<= t -3.1e+72)
(- x (* z (/ y t)))
(if (<= t 4.8e+42) (+ x (/ y (/ a z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7e+135) {
tmp = x + y;
} else if (t <= -3.1e+72) {
tmp = x - (z * (y / t));
} else if (t <= 4.8e+42) {
tmp = x + (y / (a / 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 <= (-7d+135)) then
tmp = x + y
else if (t <= (-3.1d+72)) then
tmp = x - (z * (y / t))
else if (t <= 4.8d+42) then
tmp = x + (y / (a / 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 <= -7e+135) {
tmp = x + y;
} else if (t <= -3.1e+72) {
tmp = x - (z * (y / t));
} else if (t <= 4.8e+42) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7e+135: tmp = x + y elif t <= -3.1e+72: tmp = x - (z * (y / t)) elif t <= 4.8e+42: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7e+135) tmp = Float64(x + y); elseif (t <= -3.1e+72) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t <= 4.8e+42) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7e+135) tmp = x + y; elseif (t <= -3.1e+72) tmp = x - (z * (y / t)); elseif (t <= 4.8e+42) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7e+135], N[(x + y), $MachinePrecision], If[LessEqual[t, -3.1e+72], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.8e+42], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+135}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{+72}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -7.0000000000000005e135 or 4.7999999999999997e42 < t Initial program 71.3%
+-commutative71.3%
associate-*l/94.7%
fma-def94.7%
Simplified94.7%
Taylor expanded in t around inf 82.1%
+-commutative82.1%
Simplified82.1%
if -7.0000000000000005e135 < t < -3.09999999999999988e72Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 93.5%
Taylor expanded in a around 0 87.0%
mul-1-neg87.0%
unsub-neg87.0%
associate-/l*87.1%
associate-/r/86.9%
Simplified86.9%
if -3.09999999999999988e72 < t < 4.7999999999999997e42Initial program 91.6%
+-commutative91.6%
associate-*l/93.4%
fma-def93.4%
Simplified93.4%
Taylor expanded in t around 0 71.4%
+-commutative71.4%
associate-/l*77.7%
Simplified77.7%
Final simplification79.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.05e+136)
(+ x y)
(if (<= t -2.3e+73)
(- x (/ z (/ t y)))
(if (<= t 3.4e+42) (+ x (/ y (/ a z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.05e+136) {
tmp = x + y;
} else if (t <= -2.3e+73) {
tmp = x - (z / (t / y));
} else if (t <= 3.4e+42) {
tmp = x + (y / (a / 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 <= (-1.05d+136)) then
tmp = x + y
else if (t <= (-2.3d+73)) then
tmp = x - (z / (t / y))
else if (t <= 3.4d+42) then
tmp = x + (y / (a / 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 <= -1.05e+136) {
tmp = x + y;
} else if (t <= -2.3e+73) {
tmp = x - (z / (t / y));
} else if (t <= 3.4e+42) {
tmp = x + (y / (a / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.05e+136: tmp = x + y elif t <= -2.3e+73: tmp = x - (z / (t / y)) elif t <= 3.4e+42: tmp = x + (y / (a / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.05e+136) tmp = Float64(x + y); elseif (t <= -2.3e+73) tmp = Float64(x - Float64(z / Float64(t / y))); elseif (t <= 3.4e+42) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.05e+136) tmp = x + y; elseif (t <= -2.3e+73) tmp = x - (z / (t / y)); elseif (t <= 3.4e+42) tmp = x + (y / (a / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.05e+136], N[(x + y), $MachinePrecision], If[LessEqual[t, -2.3e+73], N[(x - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+42], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+136}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{+73}:\\
\;\;\;\;x - \frac{z}{\frac{t}{y}}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.05e136 or 3.39999999999999975e42 < t Initial program 71.3%
+-commutative71.3%
associate-*l/94.7%
fma-def94.7%
Simplified94.7%
Taylor expanded in t around inf 82.1%
+-commutative82.1%
Simplified82.1%
if -1.05e136 < t < -2.3e73Initial program 99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 93.5%
Taylor expanded in a around 0 87.0%
mul-1-neg87.0%
unsub-neg87.0%
associate-/l*87.1%
associate-/r/86.9%
Simplified86.9%
*-commutative86.9%
clear-num86.9%
un-div-inv87.1%
Applied egg-rr87.1%
if -2.3e73 < t < 3.39999999999999975e42Initial program 91.6%
+-commutative91.6%
associate-*l/93.4%
fma-def93.4%
Simplified93.4%
Taylor expanded in t around 0 71.4%
+-commutative71.4%
associate-/l*77.7%
Simplified77.7%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.15e+136) (not (<= t 1.02e+58))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.15e+136) || !(t <= 1.02e+58)) {
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.15d+136)) .or. (.not. (t <= 1.02d+58))) 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.15e+136) || !(t <= 1.02e+58)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.15e+136) or not (t <= 1.02e+58): 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.15e+136) || !(t <= 1.02e+58)) 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.15e+136) || ~((t <= 1.02e+58))) 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.15e+136], N[Not[LessEqual[t, 1.02e+58]], $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.15 \cdot 10^{+136} \lor \neg \left(t \leq 1.02 \cdot 10^{+58}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -2.1499999999999999e136 or 1.02000000000000005e58 < t Initial program 70.7%
+-commutative70.7%
associate-*l/94.6%
fma-def94.5%
Simplified94.5%
Taylor expanded in t around inf 83.7%
+-commutative83.7%
Simplified83.7%
if -2.1499999999999999e136 < t < 1.02000000000000005e58Initial program 92.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 81.4%
associate-*l/84.8%
*-commutative84.8%
Simplified84.8%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.5e+137) (not (<= t 5.6e+63))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.5e+137) || !(t <= 5.6e+63)) {
tmp = x + y;
} 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 <= (-6.5d+137)) .or. (.not. (t <= 5.6d+63))) then
tmp = x + y
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 <= -6.5e+137) || !(t <= 5.6e+63)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.5e+137) or not (t <= 5.6e+63): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.5e+137) || !(t <= 5.6e+63)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.5e+137) || ~((t <= 5.6e+63))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.5e+137], N[Not[LessEqual[t, 5.6e+63]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+137} \lor \neg \left(t \leq 5.6 \cdot 10^{+63}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -6.5000000000000002e137 or 5.59999999999999974e63 < t Initial program 70.7%
+-commutative70.7%
associate-*l/94.6%
fma-def94.5%
Simplified94.5%
Taylor expanded in t around inf 83.7%
+-commutative83.7%
Simplified83.7%
if -6.5000000000000002e137 < t < 5.59999999999999974e63Initial program 92.5%
associate-/l*99.9%
Simplified99.9%
clear-num99.8%
associate-/r/99.8%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 87.6%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e-49) (not (<= z 1.05e+56))) (+ x (* y (/ z (- a t)))) (- x (/ y (+ (/ a t) -1.0)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e-49) || !(z <= 1.05e+56)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x - (y / ((a / t) + -1.0));
}
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.2d-49)) .or. (.not. (z <= 1.05d+56))) then
tmp = x + (y * (z / (a - t)))
else
tmp = x - (y / ((a / t) + (-1.0d0)))
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.2e-49) || !(z <= 1.05e+56)) {
tmp = x + (y * (z / (a - t)));
} else {
tmp = x - (y / ((a / t) + -1.0));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e-49) or not (z <= 1.05e+56): tmp = x + (y * (z / (a - t))) else: tmp = x - (y / ((a / t) + -1.0)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e-49) || !(z <= 1.05e+56)) tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); else tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.2e-49) || ~((z <= 1.05e+56))) tmp = x + (y * (z / (a - t))); else tmp = x - (y / ((a / t) + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.2e-49], N[Not[LessEqual[z, 1.05e+56]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-49} \lor \neg \left(z \leq 1.05 \cdot 10^{+56}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\end{array}
\end{array}
if z < -1.19999999999999996e-49 or 1.05000000000000009e56 < z Initial program 80.6%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
associate-/r/99.8%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 90.8%
if -1.19999999999999996e-49 < z < 1.05000000000000009e56Initial program 88.1%
+-commutative88.1%
associate-*l/91.6%
fma-def91.6%
Simplified91.6%
Taylor expanded in z around 0 82.0%
mul-1-neg82.0%
unsub-neg82.0%
*-commutative82.0%
associate-/l*93.7%
div-sub93.7%
sub-neg93.7%
*-inverses93.7%
metadata-eval93.7%
Simplified93.7%
Final simplification92.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.5e-7) (not (<= t 1.5e+42))) (+ x y) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.5e-7) || !(t <= 1.5e+42)) {
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 <= (-7.5d-7)) .or. (.not. (t <= 1.5d+42))) 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 <= -7.5e-7) || !(t <= 1.5e+42)) {
tmp = x + y;
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.5e-7) or not (t <= 1.5e+42): tmp = x + y else: tmp = x + ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.5e-7) || !(t <= 1.5e+42)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.5e-7) || ~((t <= 1.5e+42))) tmp = x + y; else tmp = x + ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.5e-7], N[Not[LessEqual[t, 1.5e+42]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-7} \lor \neg \left(t \leq 1.5 \cdot 10^{+42}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -7.5000000000000002e-7 or 1.50000000000000014e42 < t Initial program 76.7%
+-commutative76.7%
associate-*l/94.4%
fma-def94.4%
Simplified94.4%
Taylor expanded in t around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -7.5000000000000002e-7 < t < 1.50000000000000014e42Initial program 92.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 72.5%
Final simplification74.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.2e+86) (not (<= t 8e+42))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.2e+86) || !(t <= 8e+42)) {
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 <= (-7.2d+86)) .or. (.not. (t <= 8d+42))) 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 <= -7.2e+86) || !(t <= 8e+42)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.2e+86) or not (t <= 8e+42): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.2e+86) || !(t <= 8e+42)) 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 <= -7.2e+86) || ~((t <= 8e+42))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.2e+86], N[Not[LessEqual[t, 8e+42]], $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 -7.2 \cdot 10^{+86} \lor \neg \left(t \leq 8 \cdot 10^{+42}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -7.20000000000000011e86 or 8.00000000000000036e42 < t Initial program 74.0%
+-commutative74.0%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in t around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -7.20000000000000011e86 < t < 8.00000000000000036e42Initial program 91.9%
+-commutative91.9%
associate-*l/93.0%
fma-def93.0%
Simplified93.0%
Taylor expanded in t around 0 71.0%
+-commutative71.0%
associate-/l*77.1%
Simplified77.1%
clear-num77.1%
associate-/r/77.1%
clear-num77.1%
Applied egg-rr77.1%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.1e+86) (not (<= t 2.4e+42))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.1e+86) || !(t <= 2.4e+42)) {
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 <= (-1.1d+86)) .or. (.not. (t <= 2.4d+42))) 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 <= -1.1e+86) || !(t <= 2.4e+42)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.1e+86) or not (t <= 2.4e+42): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.1e+86) || !(t <= 2.4e+42)) 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 <= -1.1e+86) || ~((t <= 2.4e+42))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.1e+86], N[Not[LessEqual[t, 2.4e+42]], $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 -1.1 \cdot 10^{+86} \lor \neg \left(t \leq 2.4 \cdot 10^{+42}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.10000000000000002e86 or 2.3999999999999999e42 < t Initial program 74.0%
+-commutative74.0%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in t around inf 79.2%
+-commutative79.2%
Simplified79.2%
if -1.10000000000000002e86 < t < 2.3999999999999999e42Initial program 91.9%
+-commutative91.9%
associate-*l/93.0%
fma-def93.0%
Simplified93.0%
Taylor expanded in t around 0 71.0%
+-commutative71.0%
associate-/l*77.1%
Simplified77.1%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.08e+109) x (if (<= a 7.2e+99) (+ x y) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.08e+109) {
tmp = x;
} else if (a <= 7.2e+99) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-1.08d+109)) then
tmp = x
else if (a <= 7.2d+99) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.08e+109) {
tmp = x;
} else if (a <= 7.2e+99) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.08e+109: tmp = x elif a <= 7.2e+99: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.08e+109) tmp = x; elseif (a <= 7.2e+99) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.08e+109) tmp = x; elseif (a <= 7.2e+99) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.08e+109], x, If[LessEqual[a, 7.2e+99], N[(x + y), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.08 \cdot 10^{+109}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{+99}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.08e109 or 7.2000000000000003e99 < a Initial program 83.8%
+-commutative83.8%
associate-*l/94.2%
fma-def94.2%
Simplified94.2%
Taylor expanded in y around 0 71.4%
if -1.08e109 < a < 7.2000000000000003e99Initial program 84.9%
+-commutative84.9%
associate-*l/93.2%
fma-def93.2%
Simplified93.2%
Taylor expanded in t around inf 66.8%
+-commutative66.8%
Simplified66.8%
Final simplification68.4%
(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.6%
+-commutative84.6%
associate-*l/93.5%
fma-def93.5%
Simplified93.5%
Taylor expanded in y around 0 53.1%
Final simplification53.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 2024021
(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))))