
(FPCore (a1 a2 b1 b2) :precision binary64 (/ (* a1 a2) (* b1 b2)))
double code(double a1, double a2, double b1, double b2) {
return (a1 * a2) / (b1 * b2);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(a1, a2, b1, b2)
use fmin_fmax_functions
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: b1
real(8), intent (in) :: b2
code = (a1 * a2) / (b1 * b2)
end function
public static double code(double a1, double a2, double b1, double b2) {
return (a1 * a2) / (b1 * b2);
}
def code(a1, a2, b1, b2): return (a1 * a2) / (b1 * b2)
function code(a1, a2, b1, b2) return Float64(Float64(a1 * a2) / Float64(b1 * b2)) end
function tmp = code(a1, a2, b1, b2) tmp = (a1 * a2) / (b1 * b2); end
code[a1_, a2_, b1_, b2_] := N[(N[(a1 * a2), $MachinePrecision] / N[(b1 * b2), $MachinePrecision]), $MachinePrecision]
\frac{a1 \cdot a2}{b1 \cdot b2}
herbie shell --seed 2025191
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:alt
(! :herbie-platform c (* (/ a1 b1) (/ a2 b2)))
(/ (* a1 a2) (* b1 b2)))
Please file a bug report with this information.
| egraph-prove: cannot prove (*.f64 (/.f64 a2 b2) (/.f64 a1 b1)) is equal to (/.f64 a1 b2); not equal | L | C | |
|---|---|---|---|
| add-derivations-to | /home/nightlies/herbie/batch-reconstruct-alt/src/core/derivations.rkt | 16 | 0 |
| hash-ref! | /usr/share/racket/collects/racket/private/more-scheme.rkt | 377 | 2 |
| loop | .../private/map.rkt | 40 | 19 |
| alt-map | /home/nightlies/herbie/batch-reconstruct-alt/src/utils/alternative.rkt | 20 | 0 |
| loop | .../private/map.rkt | 40 | 19 |
| alt-map | /home/nightlies/herbie/batch-reconstruct-alt/src/utils/alternative.rkt | 20 | 0 |
| add-derivations | /home/nightlies/herbie/batch-reconstruct-alt/src/core/derivations.rkt | 30 | 0 |
| extract! | /home/nightlies/herbie/batch-reconstruct-alt/src/core/mainloop.rkt | 70 | 0 |
| run-improve! | /home/nightlies/herbie/batch-reconstruct-alt/src/core/mainloop.rkt | 42 | 0 |
| get-alternatives | /home/nightlies/herbie/batch-reconstruct-alt/src/api/sandbox.rkt | 61 | 0 |
| (unnamed) | /home/nightlies/herbie/batch-reconstruct-alt/src/api/sandbox.rkt | 181 | 6 |
| (unnamed) | /usr/share/racket/pkgs/profile-lib/main.rkt | 40 | 10 |
| profile-thunk | /usr/share/racket/pkgs/profile-lib/main.rkt | 9 | 0 |
| in-engine | /home/nightlies/herbie/batch-reconstruct-alt/src/api/sandbox.rkt | 197 | 2 |
| (unnamed) | /usr/share/racket/collects/racket/engine.rkt | 42 | 24 |