
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\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)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- t z)) (- a z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+306)))
(+ x (* (/ y (- a z)) (- t z)))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (t - z)) / (a - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+306)) {
tmp = x + ((y / (a - z)) * (t - z));
} else {
tmp = x + t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (t - z)) / (a - z);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+306)) {
tmp = x + ((y / (a - z)) * (t - z));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (t - z)) / (a - z) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+306): tmp = x + ((y / (a - z)) * (t - z)) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(t - z)) / Float64(a - z)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+306)) tmp = Float64(x + Float64(Float64(y / Float64(a - z)) * Float64(t - z))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (t - z)) / (a - z); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+306))) tmp = x + ((y / (a - z)) * (t - z)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+306]], $MachinePrecision]], N[(x + N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(t - z\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\right):\\
\;\;\;\;x + \frac{y}{a - z} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 2.00000000000000003e306 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 40.2%
+-commutative40.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
fma-undefine99.9%
associate-/l*40.2%
div-inv40.2%
*-commutative40.2%
associate-*r*99.8%
div-inv99.9%
Applied egg-rr99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.00000000000000003e306Initial program 99.5%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 83.5%
+-commutative83.5%
associate-/l*97.0%
fma-define97.0%
Simplified97.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7e+52) (not (<= z 1.85e+67))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ (* y (- t z)) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7e+52) || !(z <= 1.85e+67)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y * (t - z)) / (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 ((z <= (-7d+52)) .or. (.not. (z <= 1.85d+67))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + ((y * (t - z)) / (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 ((z <= -7e+52) || !(z <= 1.85e+67)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y * (t - z)) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7e+52) or not (z <= 1.85e+67): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + ((y * (t - z)) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7e+52) || !(z <= 1.85e+67)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(Float64(y * Float64(t - z)) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7e+52) || ~((z <= 1.85e+67))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + ((y * (t - z)) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e+52], N[Not[LessEqual[z, 1.85e+67]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+52} \lor \neg \left(z \leq 1.85 \cdot 10^{+67}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a - z}\\
\end{array}
\end{array}
if z < -7e52 or 1.8499999999999999e67 < z Initial program 64.1%
Taylor expanded in a around 0 63.6%
associate-/l*93.1%
div-sub93.1%
*-inverses93.1%
Simplified93.1%
if -7e52 < z < 1.8499999999999999e67Initial program 96.4%
Final simplification95.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.6e+26) (not (<= z 6.8e+69))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.6e+26) || !(z <= 6.8e+69)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (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 ((z <= (-1.6d+26)) .or. (.not. (z <= 6.8d+69))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (t * (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 ((z <= -1.6e+26) || !(z <= 6.8e+69)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.6e+26) or not (z <= 6.8e+69): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.6e+26) || !(z <= 6.8e+69)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.6e+26) || ~((z <= 6.8e+69))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.6e+26], N[Not[LessEqual[z, 6.8e+69]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+26} \lor \neg \left(z \leq 6.8 \cdot 10^{+69}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -1.60000000000000014e26 or 6.79999999999999973e69 < z Initial program 66.4%
Taylor expanded in a around 0 64.1%
associate-/l*91.8%
div-sub91.8%
*-inverses91.8%
Simplified91.8%
if -1.60000000000000014e26 < z < 6.79999999999999973e69Initial program 96.2%
Taylor expanded in t around inf 90.0%
mul-1-neg90.0%
associate-/l*90.4%
distribute-rgt-neg-in90.4%
distribute-frac-neg290.4%
Simplified90.4%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.5e-41) (not (<= z 4.5e-142))) (+ x (* y (- 1.0 (/ t z)))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e-41) || !(z <= 4.5e-142)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-7.5d-41)) .or. (.not. (z <= 4.5d-142))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.5e-41) || !(z <= 4.5e-142)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.5e-41) or not (z <= 4.5e-142): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.5e-41) || !(z <= 4.5e-142)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -7.5e-41) || ~((z <= 4.5e-142))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.5e-41], N[Not[LessEqual[z, 4.5e-142]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-41} \lor \neg \left(z \leq 4.5 \cdot 10^{-142}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -7.50000000000000049e-41 or 4.50000000000000019e-142 < z Initial program 76.2%
Taylor expanded in a around 0 68.3%
associate-/l*85.8%
div-sub85.8%
*-inverses85.8%
Simplified85.8%
if -7.50000000000000049e-41 < z < 4.50000000000000019e-142Initial program 97.1%
Taylor expanded in z around 0 85.1%
Final simplification85.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.65e+22) (not (<= z 3.6e+67))) (+ y x) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.65e+22) || !(z <= 3.6e+67)) {
tmp = y + x;
} else {
tmp = x + (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 ((z <= (-1.65d+22)) .or. (.not. (z <= 3.6d+67))) then
tmp = y + x
else
tmp = x + (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 ((z <= -1.65e+22) || !(z <= 3.6e+67)) {
tmp = y + x;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.65e+22) or not (z <= 3.6e+67): tmp = y + x else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.65e+22) || !(z <= 3.6e+67)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.65e+22) || ~((z <= 3.6e+67))) tmp = y + x; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.65e+22], N[Not[LessEqual[z, 3.6e+67]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+22} \lor \neg \left(z \leq 3.6 \cdot 10^{+67}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.6499999999999999e22 or 3.5999999999999999e67 < z Initial program 66.4%
+-commutative66.4%
associate-/l*100.0%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -1.6499999999999999e22 < z < 3.5999999999999999e67Initial program 96.2%
Taylor expanded in z around 0 77.7%
div-inv77.7%
*-commutative77.7%
associate-*l*77.6%
div-inv77.6%
Applied egg-rr77.6%
clear-num77.6%
un-div-inv78.2%
Applied egg-rr78.2%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.8e+20) (not (<= z 1.15e+67))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e+20) || !(z <= 1.15e+67)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-5.8d+20)) .or. (.not. (z <= 1.15d+67))) then
tmp = y + x
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.8e+20) || !(z <= 1.15e+67)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.8e+20) or not (z <= 1.15e+67): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.8e+20) || !(z <= 1.15e+67)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.8e+20) || ~((z <= 1.15e+67))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.8e+20], N[Not[LessEqual[z, 1.15e+67]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+20} \lor \neg \left(z \leq 1.15 \cdot 10^{+67}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -5.8e20 or 1.1499999999999999e67 < z Initial program 66.4%
+-commutative66.4%
associate-/l*100.0%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -5.8e20 < z < 1.1499999999999999e67Initial program 96.2%
Taylor expanded in z around 0 77.7%
div-inv77.7%
*-commutative77.7%
associate-*l*77.6%
div-inv77.6%
Applied egg-rr77.6%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.38e+219) (+ y x) (/ (* y t) (- z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.38e+219) {
tmp = y + x;
} else {
tmp = (y * 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 <= 1.38d+219) then
tmp = y + x
else
tmp = (y * 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 <= 1.38e+219) {
tmp = y + x;
} else {
tmp = (y * t) / -z;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.38e+219: tmp = y + x else: tmp = (y * t) / -z return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.38e+219) tmp = Float64(y + x); else tmp = Float64(Float64(y * t) / Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.38e+219) tmp = y + x; else tmp = (y * t) / -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.38e+219], N[(y + x), $MachinePrecision], N[(N[(y * t), $MachinePrecision] / (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.38 \cdot 10^{+219}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{-z}\\
\end{array}
\end{array}
if t < 1.3800000000000001e219Initial program 83.9%
+-commutative83.9%
associate-/l*97.3%
fma-define97.3%
Simplified97.3%
Taylor expanded in z around inf 66.2%
+-commutative66.2%
Simplified66.2%
if 1.3800000000000001e219 < t Initial program 76.3%
Taylor expanded in a around 0 76.3%
associate-/l*76.6%
div-sub76.6%
*-inverses76.6%
Simplified76.6%
Taylor expanded in t around inf 84.7%
associate-*r/84.7%
mul-1-neg84.7%
distribute-rgt-neg-out84.7%
Simplified84.7%
Taylor expanded in x around 0 69.9%
associate-*r/69.9%
mul-1-neg69.9%
distribute-rgt-neg-in69.9%
associate-*r/69.8%
Simplified69.8%
distribute-frac-neg69.8%
distribute-rgt-neg-in69.8%
distribute-lft-neg-in69.8%
associate-*r/69.9%
Applied egg-rr69.9%
Final simplification66.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.95e+219) (+ y x) (* t (/ y (- z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.95e+219) {
tmp = y + x;
} else {
tmp = t * (y / -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.95d+219) then
tmp = y + x
else
tmp = t * (y / -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.95e+219) {
tmp = y + x;
} else {
tmp = t * (y / -z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.95e+219: tmp = y + x else: tmp = t * (y / -z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.95e+219) tmp = Float64(y + x); else tmp = Float64(t * Float64(y / Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.95e+219) tmp = y + x; else tmp = t * (y / -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.95e+219], N[(y + x), $MachinePrecision], N[(t * N[(y / (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.95 \cdot 10^{+219}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{-z}\\
\end{array}
\end{array}
if t < 1.95e219Initial program 83.9%
+-commutative83.9%
associate-/l*97.3%
fma-define97.3%
Simplified97.3%
Taylor expanded in z around inf 66.2%
+-commutative66.2%
Simplified66.2%
if 1.95e219 < t Initial program 76.3%
Taylor expanded in a around 0 76.3%
associate-/l*76.6%
div-sub76.6%
*-inverses76.6%
Simplified76.6%
Taylor expanded in t around inf 84.7%
associate-*r/84.7%
mul-1-neg84.7%
distribute-rgt-neg-out84.7%
Simplified84.7%
Taylor expanded in x around 0 69.9%
associate-*r/69.9%
mul-1-neg69.9%
distribute-rgt-neg-in69.9%
associate-*r/69.8%
Simplified69.8%
Final simplification66.3%
(FPCore (x y z t a) :precision binary64 (if (<= a 5e+126) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 5e+126) {
tmp = y + x;
} 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 <= 5d+126) then
tmp = y + x
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 <= 5e+126) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 5e+126: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 5e+126) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 5e+126) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 5e+126], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5 \cdot 10^{+126}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 4.99999999999999977e126Initial program 83.5%
+-commutative83.5%
associate-/l*96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in z around inf 64.3%
+-commutative64.3%
Simplified64.3%
if 4.99999999999999977e126 < a Initial program 83.4%
+-commutative83.4%
associate-/l*97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in y around 0 72.1%
(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 83.5%
+-commutative83.5%
associate-/l*97.0%
fma-define97.0%
Simplified97.0%
Taylor expanded in y around 0 51.9%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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 / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024186
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (/ (* y (- z t)) (- z a))))